Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary Location Must be a string error #2094

Open
MajesticMinhaz opened this issue Nov 27, 2024 · 1 comment
Open

Binary Location Must be a string error #2094

MajesticMinhaz opened this issue Nov 27, 2024 · 1 comment

Comments

@MajesticMinhaz
Copy link

This is my code


    # Set up the driver instance with options (including cookies)
    options = uc.ChromeOptions()
    # options.add_argument('--headless')
    options.add_argument("--disable-blink-features")
    options.add_argument("--disable-extensions")

    driver = uc.Chrome(options=options, driver_executable_path='./chromedriver')

and this is the error

Traceback (most recent call last):
  File "/home/minhaz/PycharmProjects/facebook-page-follower-scraper/scrap_followers.py", line 185, in <module>
    driver = uc.Chrome()
             ^^^^^^^^^^^
  File "/home/minhaz/PycharmProjects/facebook-page-follower-scraper/venv/lib/python3.11/site-packages/undetected_chromedriver/__init__.py", line 372, in __init__
    options.binary_location = (
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/minhaz/PycharmProjects/facebook-page-follower-scraper/venv/lib/python3.11/site-packages/selenium/webdriver/chromium/options.py", line 54, in binary_location
    raise TypeError(self.BINARY_LOCATION_ERROR)
TypeError: Binary Location Must be a String
@marcinwrobel1986
Copy link

Hi,
your binary location could be found with:

which chromedriver

add to your code:

    binary_location = '/usr/local/bin/chromedriver'
    options.binary_location = binary_location

it should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants