Selenium opens browser but doesn't load page

前端 未结 5 1288
耶瑟儿~
耶瑟儿~ 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.

提交回复
热议问题