内网使用 python selenium报错,好像总是检查驱动的最新版本

内网(办公室局域网)环境,使用 python selenium 时报错,好像总是检查驱动的最新版本,但是内网又不通外网,所以总是失败,怎样能禁止检查?试过chrome和Firefox都这样,驱动和浏览器都已经是对应的版本了。另外如果切换到外网环境,就能正常执行。

具体报错如下
Exception trying to discover geckodriver version: error sending request for url (https://github.com/mozilla/geckodriver/releases/latest): error trying to connect: tcp connect error: 由于目标计算机积极拒绝,无法连接。 (os error 10061)
Traceback (most recent call last):
  File “c:\python\abcd.py”, line 10, in <module>
    driver = webdriver.Firefox(options=options)
  File “C:\Users\aa\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\firefox\webdriver.py”, line 60, in __init__
    self.service.start()
  File “C:\Users\aa\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py”, line 116, in start
    raise WebDriverException(f”Can not connect to the Service {self._path}”)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service C:\Program Files (x86)\Mozilla Firefox\geckodriver.exe

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
心中带点小风骚的头像心中带点小风骚普通用户
上一篇 2023年11月9日
下一篇 2023年11月9日

相关推荐