Selenium Opens Browser But Doesn't Load Page
Solution 1:
I did not add geckodriver to PATH (it is located in the same directory as Python script), and after the Selenium update to 3.0.1, use this code to start a Selenium session:
gecko = os.path.normpath(os.path.join(os.path.dirname(__file__), 'geckodriver'))
binary = FirefoxBinary(r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary, executable_path=gecko+'.exe')
Additionally: you need update geckodriver to the latest version, 0.11.1.
Solution 2:
I got the same problem with my Ubuntu 20.10 (Groovy Gorilla) installation and fixed it with the terminal using this line:
sudo apt-get install firefox-geckodriver
You can do the same with a macOS machine:
brew install geckodriver
Solution 3:
You need to set full path to executable geckodriver
as mentioned below:
self.driver = webdriver.Firefox(executable_path = 'D:\Selenium_RiponAlWasim\geckodriver-v0.18.0-win64\geckodriver.exe')
Download geckodriver
for you suitable OS → extract it in a folder of your choice → set the path correctly.
I'm using Python 3.6.2 and Selenium WebDriver 3.4.3.
Solution 4:
For Windows 10, download gechodriver. And extract it on like below. Customize it for yourself. My username is yasin in Windows 10.
C:\Users\yasin\AppData\Local\Programs\Python\Python37\Scripts
Solution 5:
For Mac users: This problem (as well as the Notarization issues with geckodriver) can be avoided by installing the software via Homebrew.
Post a Comment for "Selenium Opens Browser But Doesn't Load Page"