• selenium 3.6.0 geckodriver的一次坑


    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

    问题解决。

  • 相关阅读:
    js原生图片拼图Demo
    display:inline-block在ie7下的解决办法
    Apollo 配置中心部署注意事项
    chrony 时间同步配置
    IPv6基础介绍
    Rabbitmq 报错 nodedown
    Maven 私服你应该不陌生吧,可你会用 Artifactory 搭建吗?
    你 MySQL 中重复数据多吗,教你一招优雅的处理掉它们!
    MySQL 数据库的基本使用
    自建 yum 源
  • 原文地址:https://www.cnblogs.com/zjd2626/p/7716688.html
Copyright © 2020-2023  润新知