SeleniumHQ / selenium

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

[🐛 Bug]: ChromeDriverManager stopped working due to recent update? #14393

Closed PhillipFeldman closed 2 months ago

PhillipFeldman commented 2 months ago

What happened?

My scraper was running fine through PyCharm. Then, a late night Windows auto-update happened, so I had to restart my scraper. The auto installer is broken.

How can we reproduce the issue?

# some relevant imports
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service as ChromeService

service = ChromeService(ChromeDriverManager().install())
driver = webdriver.Chrome(service=service) #problematic line

Relevant log output

File "C:\Users\tutor\PycharmProjects\WzantBotSale\main.py", line 550, in start_helper
    driver = webdriver.Chrome(service=service, options=options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\tutor\PycharmProjects\WzantBotSale\venv\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in __init__
    super().__init__(
  File "C:\Users\tutor\PycharmProjects\WzantBotSale\venv\Lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 53, in __init__
    self.service.start()
  File "C:\Users\tutor\PycharmProjects\WzantBotSale\venv\Lib\site-packages\selenium\webdriver\common\service.py", line 98, in start
    self._start_process(self._path)
  File "C:\Users\tutor\PycharmProjects\WzantBotSale\venv\Lib\site-packages\selenium\webdriver\common\service.py", line 204, in _start_process
    self.process = subprocess.Popen(
                   ^^^^^^^^^^^^^^^^^
  File "C:\Users\tutor\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\tutor\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 193] %1 is not a valid Win32 application

Operating System

Windows 11 Pro

Selenium version

Python 4.13.0

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

Chrome Version 127.0.6533.101 (Official Build) (64-bit)

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

chromedriver64 version 127.0.6533.119

Are you using Selenium Grid?

No response

github-actions[bot] commented 2 months ago

@PhillipFeldman, 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!

diemol commented 2 months ago

ChromeDriverManager is not maintained by Selenium, we recommend getting rid of it and use https://www.selenium.dev/documentation/selenium_manager/

github-actions[bot] commented 1 month ago

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.