Skip to main content
 首页 » 编程设计

python之Selenium 错误之ConnectionResetError : [WinError 10054] An existing connection was forcibly closed by the remote host

2025年04月02日16bonelee

我正在使用 selenium 模块,但突然出现此错误

ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host 

这是我给出错误的简单代码

from selenium import webdriver 
 
browser = webdriver.Firefox() 
browser.get('https://www.instagram.com/') 

请您参考如下方法:

可能是时候为您的导航器升级 Webdriver 了。我在使用 Chrome 时遇到了同样的问题,用最新版本替换现有的 chromedriver.exe(在我的例子中是 windows)解决了这个问题。