原因
找不到driver的路径,需要将driver的路径加上
解决办法:
1. 下载:
FireFox的驱动,gechodriver(蜥蜴驱动?!),找如下链接里面对应操作系统的:
https://github.com/mozilla/geckodriver/releases
IE的驱动,edge(边界?!),找如下链接里面的Download:
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Chrome驱动,比较朴素地依旧命名为chromedriver:
https://sites.google.com/a/chromium.org/chromedriver/
其它的驱动,参考官网,能想到的驱动都在这里了。
http://www.seleniumhq.org/download/
2.代码如下:
from selenium import webdriver
chromeOptions = webdriver.ChromeOptions()
url = "https://blog.youkuaiyun.com/github_39570717/article/details/88852250"
browser = webdriver.Chrome(executable_path="E:\driver\chromedriver_win32\chromedriver.exe",chrome_options = chromeOptions)
本文详细介绍了如何解决在使用Selenium进行自动化测试时遇到的WebDriver驱动路径问题,提供了下载不同浏览器驱动的链接,并展示了如何在Python代码中指定驱动路径。
2562

被折叠的 条评论
为什么被折叠?



