I'm trying to use the webdriver and Selenium, it was working fine a couple days ago but I'm currently facing this issue where I receive this error: [Errno 8] Exec format error: '/Users/[USER]/.wdm/drivers/chromedriver/mac64/127.0.6533.72/chromedriver-mac-arm64/THIRD_PARTY_NOTICES.chromedriver'
Here is the relevant portion of code that relates to this:
options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
d_path = ChromeDriverManager().install()
driver = webdriver.Chrome(service=Service(d_path), options=options)
I have tried to manually change the d_path by replacing the 'THIRD_PARTY_NOTICES.chromedriver' with 'chromedriver' but that in itself also does not work.
Maybe is not the best solution, but, I solved it updating/installing a clean version of the webdriver-manager (min 4.0.2 version):
pip uninstall webdriver-manager
pip install webdriver-manager
And after it, removing the last entry of the drivers.json file (/Users/xxxx/.wdm/drivers.json):
"mac64_chromedriver_127.0.6533.72_for_127.0.6533": {
"timestamp": "26/07/2024",
"binary_path": "/Users/Alejandro/.wdm/drivers/chromedriver/mac64/127.0.6533.72/chromedriver-mac-x64/THIRD_PARTY_NOTICES.chromedriver"
}
I also got the same issue, was banging my head around it. Trying to install specific versions.
Ultimately the fix was to update webdriver-manager package to v4.0.2
They have fixed the issue so that correct file is chosen as driver.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With