博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
selenium 3.6.0 geckodriver的一次坑
阅读量:4677 次
发布时间:2019-06-09

本文共 1398 字,大约阅读时间需要 4 分钟。

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

问题解决。

 

转载于:https://www.cnblogs.com/zjd2626/p/7716688.html

你可能感兴趣的文章
你误解了Windows的文件后缀名吗?
查看>>
谷歌浏览器插件
查看>>
gcc malloc/free的质疑
查看>>
R 指定安装镜像的方法
查看>>
Unity shader实现水效果(折射,反射,波浪,1.菲尼尔,深度颜色)
查看>>
URAL1018 Binary Apple Tree
查看>>
Servlet注解
查看>>
今后几个月的IT读书计划
查看>>
蓝桥杯 传球游戏 动态规划
查看>>
apk反编译、smali修改、回编译笔记
查看>>
.Net程序员学习Linux最简单的方法(转载)
查看>>
基于.NET Socket API 通信的综合应用
查看>>
python 装饰器
查看>>
eclipse配置
查看>>
openGL 绘制文本font(csGL)
查看>>
BZOJ 1072 排列
查看>>
BZOJ 3779 LCT 线段树 DFS序 坑
查看>>
group by rollup | cube 学习
查看>>
上传图片的步骤
查看>>
hadoop-0.20.2完全分布式集群
查看>>