Open ManuelSalaz opened 4 months ago
I have the same issue, but using python I got this error:
HOOK-ERROR in before_scenario: OSError: [Errno 8] Exec format error: '/root/.wdm/drivers/chromedriver/linux64/127.0.6533.72/chromedriver-linux64/THIRD_PARTY_NOTICES.chromedriver'
I'm having the same issue on mac:
HOOK-ERROR in before_scenario: OSError: [Errno 8] Exec format error: '/Users/rozon/.wdm/drivers/chromedriver/mac64/127.0.6533.72/chromedriver-mac-arm64/THIRD_PARTY_NOTICES.chromedriver'
some notes:
I had the same issue. It seems that the file path in drivers.json is incorrectly specified. Manually changing the file path from THIRD_PARTY_NOTICES.chromedriver to chromedriver.exe resolved the issue, and it is now running correctly.
I might found the issue, it seems the Latest Chrome updates (https://chromereleases.googleblog.com/) introduced a THIRD_PARTY_NOTICES file within the packed archive, having that in mind the core/driver_chage._get_binary method is just ignoring the LICENSE file hence it ended up choosing the next in the queue, that is why we see the THIRD_PARTY_NOTICES.chromedriver
but that is not the executable, I don't have write access to the repo, but can someone who does, to please create a quick MR to include a logic to also ignore the third party File or pick directly the one under /chromedriver
?, would be better fix it at the code level instead changing the filename manually
if any(uf in f for uf in ['LICENSE', 'THIRD_PARTY_NOTICES']):
continue
if any(uf in f for uf in ['LICENSE', 'THIRD_PARTY_NOTICES']): continue
This worked for me, but I feel like it might lead to us playing 'whack a mole' if the driver folks keep adding to the archive...
driver_path = ChromeDriverManager().install()
if driver_path:
driver_name = driver_path.split('/')[-1]
if driver_name!="chromedriver":
driver_path = "/".join(driver_path.split('/')[:-1]+["chromedriver"])
os.chmod(driver_path, 0o755)
driver = webdriver.Chrome(service=Service(driver_path))
Try this fix, if you don't want to make changes in Package files.
That’s exactly right, @semin204 . There’s an error in the module that specifies some form of documentation as the return value of ChromeDriverManager().install(), whereas it should return the absolute path of chromedriver. It looks like an intern might have accidentally pressed the wrong button :)) !
I'm running the 4.0.2 version and still getting the error:
OSError: [WinError 193] %1 is not a valid Win32 application.
Should it be fixed in that version already? My code:
chrome_service = ChromeService(ChromeDriverManager().install())
chrome_options = Options()
driver = webdriver.Chrome(service=chrome_service, options=chrome_options)
The error began on the 127 chrome update.
@MaysonLedur Updating the version as you've done doesn't necessarily fix the problem. In fact, the problem seems to stem from the JSON file in the Chromedriver directory. Deleting the 'drivers' folder corrected the problem for me, which should solve your problem.
C:\Users\me\.wdm\drivers\chromedriver\win64\127.0.6533.72\chromedriver-win32/chromedriver.exe
netexpoarthur, thank you! That solved my problem. Have a nice one!
you can try to update. try this https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.73/win64/chromedriver-win64.zip. find it in https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json, Find the version that is closest to the latest version. then change the version number by youself. open it. and now you can download the latest version.
driver_path = ChromeDriverManager().install() if driver_path: driver_name = driver_path.split('/')[-1] if driver_name!="chromedriver": driver_path = "/".join(driver_path.split('/')[:-1]+["chromedriver"]) os.chmod(driver_path, 0o755) driver = webdriver.Chrome(service=Service(driver_path))
Try this fix, if you don't want to make changes in Package files.
If this also not works then just add .exe to chromedriver in driver_path. then that will be chromedriver.exe
You should edit this json only --> drivers.json It works)
driver_path = ChromeDriverManager().install() if driver_path: driver_name = driver_path.split('/')[-1] if driver_name!="chromedriver": driver_path = "/".join(driver_path.split('/')[:-1]+["chromedriver"]) os.chmod(driver_path, 0o755) driver = webdriver.Chrome(service=Service(driver_path))
Try this fix, if you don't want to make changes in Package files.
I got this error:
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\Administrator\\.wdm\\drivers\\chromedriver\\win64\\127.0.6533.72\\chromedriver-win32/chromedriver'
driver_path = ChromeDriverManager().install() if driver_path: driver_name = driver_path.split('/')[-1] if driver_name!="chromedriver": driver_path = "/".join(driver_path.split('/')[:-1]+["chromedriver"]) os.chmod(driver_path, 0o755) driver = webdriver.Chrome(service=Service(driver_path))
Try this fix, if you don't want to make changes in Package files.
I got this error:
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\Administrator\\.wdm\\drivers\\chromedriver\\win64\\127.0.6533.72\\chromedriver-win32/chromedriver'
Making a little change works! this is the code:
driver_path = ChromeDriverManager().install()
if driver_path:
driver_name = driver_path.split('/')[-1]
if driver_name!="chromedriver":
driver_path = "/".join(driver_path.split('/')[:-1]+["chromedriver.exe"])
os.chmod(driver_path, 0o755)
Service = ChromeService(driver_path)
driver = webdriver.Chrome(service=Service)
I think 4.0.2 already fixed this error:
then try again
I replaced
"/Users/{user}/.wdm/drivers/chromedriver/mac64/128.0.6613.137/chromedriver-mac-arm64/THIRD_PARTY_NOTICES.chromedriver"
to
"/Users/{user}/.wdm/drivers/chromedriver/mac64/128.0.6613.137/chromedriver-mac-arm64/chromedriver"
just Delete "THIRD_PARTY_NOTICES."
then fixed for me.
-Mac M1
Console Output: OSError: [WinError 193] %1 is not a valid Win32 application