报错“selenium.common.exceptions.WebDriverException: Message: ‘geckodriver’ executable needs to be in PATH. ”
需要下载geckodriver解压保存在本地
代码中添加参数
driver = webdriver.Firefox(execute_path='xxx/geckodriver-0.26.0/geckodriver')
此时报错“TypeError: init() got an unexpected keyword argument ‘execute_path’
”
参数名更改为“executable_path”即可
driver = webdriver.Firefox(executable_path='/geckodriver-0.26.0/geckodriver')