C:\Program Files\Internet Explorer
C:\Users\Administrator\AppData\Local\Google\Chrome\Application
D:\Program Files (x86)\Mozilla Firefox
D:\Programs\Python\Python38-32\
需要下载各个浏览器对应得驱动程序,放到对应的浏览器安装路径 和 python 的安装路径中。
另外,要用命令行run python程序,需要把python的安装路径添加到系统的环境变量Path中,否则,用命令 D:\PycharmProjects\pythonProject>python python_org_search.py 运行时会报错:
'python' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
Chrome报错:
1. (Session info: chrome=70.0.3538.102)
(Driver info: chromedriver=2.6.233026,platform=Windows NT 6.3 x86_64)
2. AttributeError: 'WebElement' object has no attribute 'send_keys'
解决:
check chrome version(chrome://version in browser)
下载对应版本的chromedriver.exe
(下载地址:http://chromedriver.storage.googleapis.com/index.html)
将下载的文件放到python的安装路径的Scripts D:\Prog