I've installed Firefox and Selenium on centos. I'm using Xvfb and pyvirtualdisplay to open the browser.
When I try to run selenium webdriver, I'm able to open a new display but as soon as I do
browser = webdriver.Firefox()
I get the error:
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 134, in __init__
self.service = Service(executable_path, log_path=log_path)
File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/service.py", line 45, in __init__
log_file = open(log_path, "a+")
IOError: [Errno 13] Permission denied: 'geckodriver.log'
Any clues on what's going wrong here?
EDIT : After overcoming the permission error, I'm getting
Message: 'geckodriver' executable needs to be in PATH
I had this same issue recently on a Windows 10 workstation. I fixed it by explicitly setting the service_log_path to a location I know I've got write access to:
browser = webdriver.Firefox(
service_log_path="C:\\Users\\[username]\\AppData\\Local\\Temp\\geckodriver.log"
)
I had this exact same error.
[Errno 13] Permission denied: 'geckodriver.log'
The problem was not at all with this .log file.
The real problem was that my script (.py file) and the geckodriver.exe were not located in the same folder.
Once I put them in the same folder, the problem was solved and the function was executed normally.
browser = webdriver.Firefox()
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With