ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.71k stars 1.14k forks source link

What's wrong here? #1642

Open MajesticMinhaz opened 11 months ago

MajesticMinhaz commented 11 months ago

Code

# create the driver instance
options = ChromeOptions()
options.add_argument("--headless")
driver = Chrome(options=options, driver_executable_path=config.get('DRIVER_PATH'), use_subprocess=False)

Error

Traceback (most recent call last):
  File "/home/mdminhaz/vscode_project/instagram_follower_scraper/scrap_followers.py", line 24, in <module>
    driver = Chrome(options=None, driver_executable_path=config.get('DRIVER_PATH'), use_subprocess=False)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mdminhaz/vscode_project/instagram_follower_scraper/venv/lib/python3.11/site-packages/undetected_chromedriver/__init__.py", line 372, in __init__
    options.binary_location = (
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mdminhaz/vscode_project/instagram_follower_scraper/venv/lib/python3.11/site-packages/selenium/webdriver/chromium/options.py", line 52, in binary_location
    raise TypeError(self.BINARY_LOCATION_ERROR)
TypeError: Binary Location Must be a String
eic0 commented 7 months ago

"TypeError: Binary Location Must be a String" - can't find the chrome executable on the standard path. I had the problem because I didn't have chrome installed. Because apparently the webdriver also needs the normal executable.