Selenium Chromedriver超时,之前正在工作

Selenium Chromedriver超时,之前正在工作,selenium,google-chrome,selenium-chromedriver,Selenium,Google Chrome,Selenium Chromedriver,我正在使用Selenium/python combo,我有一堆脚本,它们工作得非常好。然后我停止使用它们一个月,现在我得到了超时错误。我在网上尝试了一些解决方案,但似乎没有任何效果 这是设置: selenium 3.141.0 chrome 86.0.4240.75 chromedriver 86.0.4240.22 我得到的错误是: [11-28-2020 23:33:28.070][INFO]: Launching chrome: "C:\Program Fi

我正在使用Selenium/python combo,我有一堆脚本,它们工作得非常好。然后我停止使用它们一个月,现在我得到了超时错误。我在网上尝试了一些解决方案,但似乎没有任何效果

这是设置:

selenium     3.141.0
chrome       86.0.4240.75
chromedriver 86.0.4240.22
我得到的错误是:

[11-28-2020 23:33:28.070][INFO]: Launching chrome: "C:\Program Files\Google\Chrome\Application\googlechrome.exe" --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --log-level=0 --no-first-run --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir="C:\Users\VB\AppData\Local\Temp\scoped_dir29140_1635643004" data:,
[11-28-2020 23:33:28.589][INFO]: resolved localhost to ["::1","127.0.0.1"]
[11-28-2020 23:33:32.588][WARNING]: Timed out connecting to Chrome, retrying...
[11-28-2020 23:33:32.588][INFO]: resolved localhost to ["::1","127.0.0.1"]
[11-28-2020 23:33:40.598][WARNING]: Timed out connecting to Chrome, retrying...
[11-28-2020 23:33:40.598][INFO]: resolved localhost to ["::1","127.0.0.1"]
[11-28-2020 23:33:56.604][WARNING]: Timed out connecting to Chrome, giving up.
[11-28-2020 23:33:56.606][INFO]: resolved localhost to ["::1","127.0.0.1"]
[11-28-2020 23:34:00.615][WARNING]: Timed out connecting to Chrome, retrying...
[11-28-2020 23:34:00.615][INFO]: resolved localhost to ["::1","127.0.0.1"]
[11-28-2020 23:34:08.627][WARNING]: Timed out connecting to Chrome, retrying...
[11-28-2020 23:34:08.627][INFO]: resolved localhost to ["::1","127.0.0.1"]
[11-28-2020 23:34:24.634][WARNING]: Timed out connecting to Chrome, giving up.
[11-28-2020 23:34:24.659][INFO]: [fcdf702ffc801fde76b9fd0d0815b3df] RESPONSE InitSession ERROR session not created
from disconnected: unable to connect to renderer
  (Session info: chrome=86.0.4240.75)
这是我的chrome/chromedriver配置:

options = Options()
options.binary_location = 'C:\Program Files\Google\Chrome\Application\googlechrome.exe'
chrome_driver_binary = "C:\Program Files\Chromedriver\chromedriver.exe"
driver = webdriver.Chrome(chrome_driver_binary, options=options, service_args=["--disable-gpu","--readable-timestamp","--log-path=C://DOCS//python//" + className + "_" + memberName + "_TEST_chromedriver.log"])
我更改了主机以添加:

127.0.0.1       localhost
堆栈跟踪:

Traceback (most recent call last):
  File "C:/DOCS/python/gym/main.py", line 21, in <module>
    driver = webdriver.Chrome(chrome_driver_binary, options=options, service_args=["--disable-gpu","--readable-timestamp","--log-path=C://DOCS//python//" + className + "_" + memberName + "_TEST_chromedriver.log"])
  File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created
from disconnected: unable to connect to renderer
  (Session info: chrome=86.0.4240.75)
我尝试将chrome和chromedriver升级到v87,但出现了相同的错误,所以我恢复到了86。正如我之前所说,它工作得很好。我想不出有什么特别的变化


任何关于尝试什么的想法都很好。

我看到的都是信息和警告信息。没有错误。你的脚本有效吗?能否将错误消息和堆栈跟踪添加到问题中?请将其添加到问题中。在评论中阅读太难了。请将您的问题包含在这些信息中。详细信息已添加到原始帖子中。。谢谢你的帮助。我要补充的是,当我从pyCharm手动运行它时,它会启动一个Chrome实例,但在失败之前什么都不做。我看到的只是信息和警告消息。没有错误。你的脚本有效吗?能否将错误消息和堆栈跟踪添加到问题中?请将其添加到问题中。在评论中阅读太难了。请将您的问题包含在这些信息中。详细信息已添加到原始帖子中。。谢谢你的帮助。只是补充一下,当我从pyCharm手动运行它时,它会启动一个Chrome实例,但在失败之前什么都不做。
LINE 18: options = Options()
LINE 19: options.binary_location = 'C:\Program Files\Google\Chrome\Application\googlechrome.exe'
LINE 20: chrome_driver_binary = "C:\Program Files\Chromedriver\chromedriver.exe"
LINE 21: driver = webdriver.Chrome(chrome_driver_binary, options=options, service_args=["--disable-gpu","--readable-timestamp","--log-path=C://DOCS//python//" + className + "_" + memberName + "_TEST_chromedriver.log"])