我把谷歌下好,对应的驱动器也下好了,在chrome里替换了相关文件,python里也进行打了替换。
from selenium import webdriver
网址=webdriver.Chrome('http://www.baidu.com')
selenium.common.exceptions.WebDriverException: Message: 'www.baidu.com' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
请问我错在哪里可以解决这个问题
我具体的解决方案如下:
driver=webdriver.Chrome('http://www.baidu.com')这句是定义一个浏览器对象,可以不带参数,或参数是指定的驱动路径。而不是直接将url传递给它,
定义好的driver,再用,driver.get(url)
如有帮助,请点采纳。