解决:webdriver.Firefox错误OSError: [Errno 20] Not a directory:

遇到错误
OSError: [Errno 20] Not a directory: ‘/Users/PycharmProjects/automation_framework_demo/myself/geckodriver’

driver = webdriver.Firefox('/Users/PycharmProjects/automation_framework_demo/myself/geckodriver')

上面错误是因为参数名要加上executable_path=,否则默认是把值传给了另一个参数

driver = webdriver.Firefox(executable_path='geckodriver')

不同版本Firefox驱动下载
https://github.com/mozilla/geckodriver

猜你喜欢

转载自blog.csdn.net/weixin_38892128/article/details/86642990