python+selenium调用Firefox浏览器exception处理
今天用selenium的webdriver调用Firefox浏览器遇到了异常:
WebDriverException: Message: ‘geckodriver’ executable needs to be in PATH.
百度之后说没有geckodriver.exe,于是去github下载,之后放到了浏览器安装目录下和python安装目录下。并且把浏览器的安装目录添加到系统环境变量的path中去。
在进行webdriver调用时还是异常,但是变成了:
raise WebDriverException(“Can not connect to the Service %s” % self.path)
之后又百度,说是localhost问题,把ipv6的地址注释掉(#::1)之后可以正常运行了。