Question
Running selenium on a droplet
I am trying to run selenium webdriver on my droplet, and after days of unsuccessful attempts, I need some help. Here’s what I have done:
Hooked up a display:
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(1024, 768))
display.start()
Here’s where it chokes for Chrome:
b = webdriver.Chrome() #doesn’t choke yet, but definitely hangs for longer than normal..
b
<selenium.webdriver.chrome.webdriver.WebDriver (session=“7725d000781011a8e713a7fd722361b4”)>
b.get(’https://www.google.com’) #and there it is…
selenium.common.exceptions.WebDriverException: Message: unknown error: Runtime.executionContextCreated has invalid ‘context’: {“auxData”:{“frameId”:“1342.1”,“isDefault”:true},“id”:1,“name”:“”,“origin”:“://”}
(Session info: chrome=55.0.2883.87)
(Driver info: chromedriver=2.9.248304,platform=Linux 4.4.0-59-generic x86_64)
And here’s where it chokes for Firefox:
b = webdriver.Firefox()
selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: 2
I have tried at least 4 versions of different chrome drivers. I have selenium working on my personal box (I use Chrome) with this similar setup, but I don’t use/need the display. I am running the cheap droplet, 512mb, 5$, but I resized it to 4 GB of memory and it still fails, so its not there?
Thank you very much.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×