谁有这个图的1920格式啊 想图一hunta 236 拿去吧做壁纸

windows下python利用webdriver打开firefox总是卡住? - 开源中国社区
当前访客身份:游客 [
当前位置:
# coding = utf-8
from selenium import webdriver
# from mon.keys import keys
dr=webdriver.Firefox()
dr.get(&http://www.python.org&)
print dr.title
dr.close()
这段代码在执行后firefox打开之后就卡在那不运行了,初接触selenium,不知道是什么问题?
共有1个答案
<span class="a_vote_num" id="a_vote_num_
我用chrome遇到了同样的问题,&Can not connect to the ChromeDriver&,好像是端口问题
用pythonWin单步运行发现卡在utils.is_connectable(self.port)
while not utils.is_connectable(self.port):
count += 1
time.sleep(1)
if count == 30:
raise WebDriverException(&Can not connect to the ChromeDriver&)
utils.py中socket_.connect((&localhost&, port))提示socket.timeout: timed out
def is_connectable(port):
Tries to connect to the server at port to see if it is running.
- port: The port to connect.
socket_ = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_.settimeout(1)
socket_.connect((&localhost&, port))
socket_.close()
return True
except socket.error:
return False
--- 共有 3 条评论 ---
: 但我用Python2仍是如此阿
(1年前)&nbsp&
你竟然在用python3
(3年前)&nbsp&
知道原因了,Selenium的运行环境和python3兼容不好
(3年前)&nbsp&
更多开发者职位上
有什么技术问题吗?
沈园的其它问题
类似的话题公众号:gh_74fd66d0d77c
专业的python学习公众号,有资源下载,真人指导,定期推送,各类活动。帮助pythoner快速提升自己的能力。
感谢您阅读使用Python控制Firefox! ,本文可能来自网络,如果侵犯了您的相关权益,请联系管理员。QQ:}

我要回帖

更多关于 图一hunta 236 拿去吧 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信