(MAC)报错使用selenium时报错问题

MAC报错selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. ”及“TypeError: __init__ got an unexpected keyword argument 'execute_path'


)

报错“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')

你可能感兴趣的:(selenium,python)