SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.74k stars 8.02k forks source link

[🐛 Bug]:error sending request for url (https://chromedriver.storage.googleapis.com/LATEST_RELEASE): error trying to connect: 远程主机强迫关闭了一个现有的连接。 (os error 10054) #14131

Closed c469591 closed 2 weeks ago

c469591 commented 2 weeks ago

What happened?

This error occurs in some restricted network environments when using selenium 4.9. error sending request for url (https://chromedriver.storage.googleapis.com/LATEST_RELEASE): error trying to connect: The remote host forced an existing connection to close. (os error 10054) When this error occurs, selenium becomes completely unusable. And I've already manually specified the exe paths for chrome and chrome driver, so he shouldn't have to visit the specified url. Here's the code I used to specify the chrome and chrome driver

                self.chrome_options = Options()
                self.chrome_options.binary_location = r'.\chrome-win64\chrome.exe'
                self.ser = Service(executable_path=r'.\chrome-win64\chromedriver.exe')
        self.browser = webdriver.Chrome(service=self.ser, options=self.chrome_options)

How can we reproduce the issue?

It may be necessary to change the firewall settings so that the firewall blocks access to https://chromedriver.storage.googleapis.com/LATEST_RELEASE, which should reproduce the issue

Relevant log output

error sending request for url (https://chromedriver.storage.googleapis.com/LATEST_RELEASE): error trying to connect: The remote host forced an existing connection to close. (os error 10054)

Operating System

windows10

Selenium version

4.9

What are the browser(s) and version(s) where you see this issue?

chrome115

What are the browser driver(s) and version(s) where you see this issue?

chromedriver115

Are you using Selenium Grid?

no

github-actions[bot] commented 2 weeks ago

@c469591, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

titusfortner commented 2 weeks ago

You're right if you have specified the path of a driver, Selenium should not be trying to locate one for you. Can you turn on logging to debug mode and see what logic is executing?

github-actions[bot] commented 2 weeks ago

We need more information about this issue in order to troubleshoot.

Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our Troubleshooting documentation.

c469591 commented 2 weeks ago

hi, I reinstalled selenium when I was writing debugging code, and found that after installing version 4.21, I don't have the problem I mentioned before. thank you!

diemol commented 2 weeks ago

Great, thanks for letting us know!

titusfortner commented 2 weeks ago

🤦 I can't believe I missed the older version in the initial report. Selenium Manager has come a long way since then. Thanks.