I'm needing help from you Python pros....I've got a pretty basic/simple Python script that scrapes a website and modifies some stuff in my account. The script works with Python2, but I'm wanting to get it to work in the python3 environment. I switch to python2 by:
$ sudo -s update-alternatives --config python
and selecting option 1.
After a bit of troubleshooting, I've narrowed it down to something with selenium and firefox. Just executing select commands from IDLE causes the firefox related errors below.
Code: Select all
import time, os, datetime, selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
driver = webdriver.Firefox()
File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/webdriver.py", line 194, in __init__
self.service.start()
File "/usr/lib/python3/dist-packages/selenium/webdriver/common/service.py", line 106, in start
self.assert_process_still_running()
File "/usr/lib/python3/dist-packages/selenium/webdriver/common/service.py", line 119, in assert_process_still_running
raise WebDriverException(f"Service {self.path} unexpectedly exited. Status code was: {return_code}")
selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: 1
However, if instead of firefox, I attempt the same with chrome, it opens and closes without issue.
Code: Select all
driver = webdriver.Chrome()
driver.close()