首页 > 解决方案 > 仅在我的机器上出现错误 10054“现有连接被远程主机强制关闭”?

问题描述

我正在尝试使用 Python/Selenium 启动 Internet Explorer Web 浏览器。当我尝试运行代码时,收到如上所述的错误“urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, '现有连接被远程主机强行关闭', None, 10054,没有任何))”。

这个错误只发生在我的机器上,我的同事机器似乎能够很好地启动代码/浏览器。

阅读各种网站,尝试所有解决方案:https ://www.joecolantonio.com/selenium-webdriver-fix-for-3-common-ie-errors/ 。

从 selenium 导入 webdriver 导入 selenium

驱动程序 = selenium.webdriver.Ie()

driver.get(' http://www.google.com ')

预期结果应该是 Internet Explorer Web 浏览器打开并导航到 google.com。

实际结果是 Error 10054: urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forced closed by the remote host', None, 10054, None))

标签: pythonseleniumiedriverserver

解决方案


推荐阅读