【发布时间】:2018-07-19 16:58:55
【问题描述】:
我是 Python 新手,正在阅读 Automate The Boring Stuff 一书 (https://automatetheboringstuff.com/chapter11/)
目前我遇到了一个错误。我已经在谷歌上搜索了几个小时,但似乎找不到类似的东西或对我有用的东西。
这是我的代码:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('https://google.com')
我一直遇到这个错误:
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
除了使用 pip.exe 安装 selenium 之外,我还必须安装 Geckodriver。我将 Geckodriver 添加到 PATH 以修复另一个错误。我还尝试将 Python、IDLE、Geckodriver 和 Selenium 添加到 Windows 防火墙异常中。最后,我禁用了我的防病毒软件 (Avast) 的所有组件。
有什么建议或可以尝试的方法吗?我的目标是在网页上执行操作,例如单击字段、输入文本等。
感谢您的帮助!
【问题讨论】:
标签: python-3.x selenium-webdriver windows-10 geckodriver