Selenium-socket.error:[Errno 111]连接被拒绝 [英] Selenium - socket.error: [Errno 111] Connection refused
本文介绍了Selenium-socket.error:[Errno 111]连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试为我的Web应用程序创建Selenium测试.到目前为止,我有:
I'm trying to create Selenium tests for my web application. So far I have:
from selenium import webdriver
import httplib
driver = webdriver.Chrome('v1/chromedriver-Linux64')
#in tutorial, it was just webdriver.Chrome() but that didn't work
url = "http://127.0.0.1:8000/loty/accounts/login/"
try:
driver.get(url)
except httplib.BadStatusLine as bsl:
pass
#in tutorial, it was just driver.get(url) but that didn't work
driver.find_element_by_css_selector("#menu")
不幸的是,我得到一个 long traceback 以 socket.error结尾:[Errno 111]连接被拒绝
.我如何使它工作?
Unfortunately, I get a long traceback ending with socket.error: [Errno 111] Connection refused
. How can I get it to work?
推荐答案
您的chrome驱动程序不支持您的chrome浏览器版本.chromedriver 2.38支持v65-67.所以这似乎是一个配置问题.在下面使用此按钮安装最新版的chrome驱动程序.
You've chrome driver which doesn't support your version of chrome browser. v65-67 is supported by chromedriver 2.38. so it seems a config issue. Use below to install latest version of chrome driver.
http://chromedriver.chromium.org/downloads
这篇关于Selenium-socket.error:[Errno 111]连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文