抛出问题:
window系统python的shell脚本运行脚本报错:Traceback (most recent call last):
File "D:\python-py\ceshi.py", line 2, in <module>
driver=webdriver.Firefox()
File "C:\Python36\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
self.service.start()
File "C:\Python36\lib\site-packages\selenium\webdriver\common\service.py", line 104, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service geckodriver
大概意思就是geckodriver驱动调用Firefox有问题
找各种报错的原因
1、百度上的方法修改了host文件也ping通了
ping localhost来自127.0.0.1的回复,对着呢!
2、geckodriver.exe程序放在了python36文件夹下
path的环境变量也配置了 也对着呢!
右击我的电脑->属性->高级系统设置->环境变量->系统变量中选择path->编辑添加geckodriver.exe的路径