from selenium import webdriver from selenium.webdriver.firefox.firefox_binary import FirefoxBinary # firfoxdriver 为 你的firefox安装路径 firfoxdriver = 'C:Program Files (x86)Mozilla FirefoxFirefox.exe' binary = FirefoxBinary(firfoxdriver) browser = webdriver.Firefox(firefox_binary=binary,executable_path='C:geckodriver') browser.get('http://www.163.com')