Selenium opens a browser but does not load a page

this is an extension from a previous post that I made here that I could not work with, but now I get a new error after updating Selenium.

I am using Python 3.5, Windows 8.1, Selenium 3.0.1

I know that the code works because it works on my MAC, but when I transfer it to my working computer, which is described above, the only thing that happens is to open a browser, but it will not load anything, not even the home page.

From everything that I could find in the search, I downloaded geckodriver, renamed it to wire.exe and added the directory to the PATH system.

sys

I completely lost what to do to make it work. Here is the im code using:

from selenium import webdriver driver = webdriver.Firefox() driver.get('https://www.google.com') 

Here are the errors I get:

error

+4
python firefox selenium geckodriver
source share
2 answers

I did not add geckodriver to PATH (it is in the same directory as the Python script), and after upgrading selenium to 3.0.1, this code is used 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') 

Optional: you need to update geckodriver to the latest version 0.11.1.

+11
source share

You need to set the geckodriver path as follows:

 self.driver = webdriver.Firefox(executable_path = 'D:\Selenium_RiponAlWasim\geckodriver-v0.18.0-win64\geckodriver.exe') 

Download geckodriver for your suitable OS → Extract it to the folder of your choice → Set the path correctly.

I am using Python 3.6.2 and Selenium WebDriver 3.4.3

0
source share

All Articles