I get the following error message when I try and run scraper.py. I have the most recent driver installed and updated google chrome. I tried manually putting in the driver path but I get a similar error. I am running these commands both on terminal and Jupyter notebook in a virtual environment.
Traceback (most recent call last):
File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 38, in get_path
path = SeleniumManager().driver_location(options) if path is None else path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 98, in driver_location
output = self.run(args)
^^^^^^^^^^^^^^
File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 144, in run
raise WebDriverException(f"Unsuccessful command executed: {command}.\n{result}{stderr}")
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: /Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/macos/selenium-manager --browser chrome --output json.
{'code': 65, 'message': 'No such file or directory (os error 2) at path "/private/tmp/PKInstallSandbox.sM86By/tmp/selenium-managerdAysEG"', 'driver_path': '', 'browser_path': ''}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/xxx/Instagram-Comments-Scraper/scraper.py", line 5, in
driver = webdriver.Chrome()
^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init
super().init(
File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 51, in init
self.service.path = DriverFinder.get_path(self.service, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 41, in get_path
raise NoSuchDriverException(msg) from err
selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
I get the following error message when I try and run scraper.py. I have the most recent driver installed and updated google chrome. I tried manually putting in the driver path but I get a similar error. I am running these commands both on terminal and Jupyter notebook in a virtual environment.
Traceback (most recent call last): File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 38, in get_path path = SeleniumManager().driver_location(options) if path is None else path ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 98, in driver_location output = self.run(args) ^^^^^^^^^^^^^^ File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 144, in run raise WebDriverException(f"Unsuccessful command executed: {command}.\n{result}{stderr}") selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: /Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/macos/selenium-manager --browser chrome --output json. {'code': 65, 'message': 'No such file or directory (os error 2) at path "/private/tmp/PKInstallSandbox.sM86By/tmp/selenium-managerdAysEG"', 'driver_path': '', 'browser_path': ''}
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/Users/xxx/Instagram-Comments-Scraper/scraper.py", line 5, in
driver = webdriver.Chrome()
^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init
super().init(
File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 51, in init
self.service.path = DriverFinder.get_path(self.service, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Instagram-Comments-Scraper/.venv/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 41, in get_path
raise NoSuchDriverException(msg) from err
selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location