Firefox version compatibility issues with geckodriver

Open the python shell, execute the following script:

from selenium import webdriver
driver = webdriver.Firefox()
driver.maximize_window()
driver.get("http://baidu.com")

When the script execution to the  driver = webdriver.Firefox ()  when this sentence, pages stuck that firefox browser is successfully opened, but not maximized as intended, and access Baidu. Online search for a long time, finally found the answer and solve the problem.

This is a compatibility problem, because firefox version match the version with geckodriver cause, my firefox version 56, but geckodriver version used is 25, apparently geckodriver version is too high, it will be replaced after 20 geckodriver,

Just re-run of the script, the problem is solved. geckodriver Download: https://github.com/mozilla/geckodriver/releases

 

   Attached: Firefox and geckodriver version of the mapping table

NOTE: In this thanks https://blog.csdn.net/yinshuilan/article/details/90713084, provides Firefox and geckodriver version of the mapping table, so I do not have the version matching trial and error.

Guess you like

Origin www.cnblogs.com/jjstrip/p/11670842.html