码迷,mamicode.com
首页 > 其他好文 > 详细

selenium 3.6.0 geckodriver的一次坑

时间:2017-10-23 15:05:03      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:ram   check   driver   lib   comm   ini   lin   list   bdr   

Traceback (most recent call last):
  File "./se3.py", line 16, in <module>
    dr=webdriver.Firefox(firefox_binary=binary,executable_path=driver_path)
  File "/opt/python36/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 154, in __init__
    keep_alive=True)
  File "/opt/python36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 151, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/opt/python36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 240, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/opt/python36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute
    self.error_handler.check_response(response)
  File "/opt/python36/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: failed to lookup address information: Name does not resolve

一开始以为是geckodriver的问题,于是在不同的geckodriver换来换去,firefox也试过不同的版本,然而并没有解决。百度了一下也没有相关的问题。

最后还是看错误信息,failed to lookup address information: Name does not resolve,

启动geckodriver的时候1508740937900    geckodriver    INFO    Listening on 127.0.0.1:4444

想到会不会是/etc/hosts的问题,于是在/etc/hosts上添加

127.0.0.1   localhost

问题解决。

 

selenium 3.6.0 geckodriver的一次坑

标签:ram   check   driver   lib   comm   ini   lin   list   bdr   

原文地址:http://www.cnblogs.com/zjd2626/p/7716688.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!