Selenium opens browser but doesn't load page

前端 未结 5 1286
耶瑟儿~
耶瑟儿~ 2020-12-06 12:58

this is an extension from a previous post I made Here which I could not get to work but I am now getting a new error after updating Selenium.

I am using Python 3.5,

相关标签:
5条回答
  • 2020-12-06 13:21

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

    0 讨论(0)
  • 2020-12-06 13:23

    For windows10 downloadgechodriver

    and extract it on like below . customize it for yourself. my username is yasin in windows10

    C:\Users\yasin\AppData\Local\Programs\Python\Python37\Scripts
    
    0 讨论(0)
  • 2020-12-06 13:25

    I got the same problem with my Ubuntu 20.10 and fixed it with the terminal using this line:

    sudo apt-get install firefox-geckodriver 
    

    You can do the same with a macOS:

    brew install geckodriver
    

    Here ya go mate, anybody who is deep in this problem can solve theirs with this.

    0 讨论(0)
  • 2020-12-06 13:26

    For Mac users: This problem (as well as the Notarization issues with geckodriver) can be avoided by installing the software via homebrew.

    0 讨论(0)
  • 2020-12-06 13:40

    You need to set geckodriver path 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

    0 讨论(0)
提交回复
热议问题