Working with selenium, I wanted to work on a script that ran absolutely fine in the past, but suddenly doesn’t.
Someone here has had the same problem in the past, and it was an error with python itself. Other than uninstalling and reinstalling python (I’m fairly new to programming and using vscode, I’d find this very tedious), I don’t know what would fix it. I haven’t changed anything in the script or with python, and so I can’t imagine where the problem comes from.
The code:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
options = webdriver.ChromeOptions()
options.add_argument('log-level=3')
driver = webdriver.Chrome(options=options, service=Service(ChromeDriverManager().install()))
The error message:
"C:Users19DelgadoJosAppDataLocalProgramsPythonPython312Libsite-packagesseleniumwebdriverchromewebdriver.py", line 45, in __init__
super().__init__(
File "C:Users19DelgadoJosAppDataLocalProgramsPythonPython312Libsite-packagesseleniumwebdriverchromiumwebdriver.py", line 50, in __init__
self.service.start()
File "C:Users19DelgadoJosAppDataLocalProgramsPythonPython312Libsite-packagesseleniumwebdrivercommonservice.py", line 98, in start
self._start_process(self._path)
File "C:Users19DelgadoJosAppDataLocalProgramsPythonPython312Libsite-packagesseleniumwebdrivercommonservice.py", line 208, in _start_process
self.process = subprocess.Popen(
^^^^^^^^^^^^^^^^^
File "C:Users19DelgadoJosAppDataLocalProgramsPythonPython312Libsubprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:Users19DelgadoJosAppDataLocalProgramsPythonPython312Libsubprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^OSError: [WinError 193] %1 is not a valid Win32 application
PS C:Users19DelgadoJosDesktopCodevideomaker>
Thanks in advance for any help!