from selenium import webdriver
d=webdriver.Chrome('G:\software\Google\Chrome\Application\chromedriver.exe')
d.get("http://www.baidu.com")
print(d.page_source)
很多人在调用webdriver的时候无法打开游览器,即便是配置了环境变量也不行。
解决方法:
将webdriver.chrome里面加上chromedriver.exe
记住你的浏览器必须是32位的。