Reputation: 64
So I started with 'Automate the boring stuff with Python' and now studying Chapter 11, i.e. Web scraping. During this, I struggled to get my selenium working with Firefox. The version details are as follows:
Windows 10 Pro (64 bit)
Firefox: 81.0 (64 bit) (Latest at the time of writing)
Python: 3.7.9
Selenium: 3.141.0
Geckodriver: 0.27
When I ran the following script, it crashed with an exception:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.python.org")
Exception:
Unable to find a matching set of capabilities
I downloaded Firefox installer (using the Firefox browser) , installed it again, which was the same version and the problem magically disappeared. My question is more about the cause of the problem, which is still unknown to me. What could have caused the script to crash for the first time, since practically I did not change anything.
Upvotes: 1
Views: 48
Reputation: 10227
2 guesses:
driver = webdriver.Firefox(
executable_path='/path/to/geckodriver',
firefox_binary='/path/to/firefox/binary'
)
Upvotes: 2