Code Monkey home page Code Monkey logo

instagram-comments-scraper's Issues

IndexError: pop from empty list

Hi, i have this error, need help

python scraper.py https://www.instagram.com/p/CqT0ukiMbPf/ 5

DevTools listening on ws://127.0.0.1:55766/devtools/browser/466cc3f1-af4c-456b-95e8-8542b7cfb023
[10536:5680:0329/115639.286:ERROR:device_event_log_impl.cc(222)] [11:56:39.286] USB: usb_device_handle_win.cc:1046 Failed to read descriptor from node connection: Uno de los dispositivos conectados al sistema no funciona. (0x1F)
[10536:5680:0329/115639.288:ERROR:device_event_log_impl.cc(222)] [11:56:39.288] USB: usb_device_handle_win.cc:1046 Failed to read descriptor from node connection: Uno de los dispositivos conectados al sistema no funciona. (0x1F)
[10536:5680:0329/115639.289:ERROR:device_event_log_impl.cc(222)] [11:56:39.289] USB: usb_device_handle_win.cc:1046 Failed to read descriptor from node connection: Uno de los dispositivos conectados al sistema no funciona. (0x1F)
'WebDriver' object has no attribute 'find_element_by_css_selector'
Traceback (most recent call last):
File "C:\Users\cgpal\Downloads\Instagram-Comments-Scraper-master\Instagram-Comments-Scraper-master\scraper.py", line 43, in
user_names.pop(0)
IndexError: pop from empty list

Issue while running script

Hello, I tried to use this script to export my post comments but it returned me this error:

DevTools listening on ws://127.0.0.1:50372/devtools/browser/27e55efd-868a-47ee-be40-8ea50e4f0fdc [8516:1592:0609/184722.876:ERROR:browser_process_sub_thread.cc(221)] Waited 420 ms for network service
And suddenly closed the chrome web drive

How to resolve it?
Thanks

Alawys only get 25 comments

I always got this:
DevTools listening on ws://127.0.0.1:1067/devtools/browser/c5dd8a90-5b53-43b0-bdc6-b9233dc94dca Found <selenium.webdriver.remote.webelement.WebElement (session="33dbdedbb8facdf838e849681b3a738b", element="1479d7a5-4e15-47ce-91dd-e45ebc5e0206")> Message: no such element: Unable to locate element: {"method":"css selector","selector":".MGdpg > button:nth-child(1)"} (Session info: chrome=94.0.4606.61)

My parameter is 5 and time 1.5, why?

Unable to obtain driver for chrome using Selenium Manager

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

Limit

mas Agi, apakah scrapernya ada limitnya? saya scrap foto dengan 500 komentar tapi di komentar ke 10 sudah berhenti

Error when running script

Hi, sorry if this is a noob question. I've just tried to run the code and I ended up with this error. (I've been reinstalling and manually specifying the path to chromedriver.exe all day and it still doesn't work! Help me out please?)

C:\Users\user1\Instagram-Comments-Scraper>python scraper.py https://www.instagram.com/p/BqUfulwH6O4/ 5
Traceback (most recent call last):
File "C:\Users\user1\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "scraper.py", line 5, in
driver = webdriver.Chrome()
File "C:\Users\user1\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init
self.service.start()
File "C:\Users\user1\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

error chrome

pas di running selalu error

Traceback (most recent call last):
File "scraper.py", line 5, in
driver = webdriver.Chrome()
File "/root/Instagram-Comments-Scraper/.venv/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in init
desired_capabilities=desired_capabilities)
File "/root/Instagram-Comments-Scraper/.venv/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "/root/Instagram-Comments-Scraper/.venv/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/root/Instagram-Comments-Scraper/.venv/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/root/Instagram-Comments-Scraper/.venv/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

padahal versi driver sama chrome udah sama (90.0.4430.93-0ubuntu0.18.04.1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.