agimaulana / instagram-comments-scraper Goto Github PK
View Code? Open in Web Editor NEWInstagram comment scraper using python and selenium. Save the comments into excel.
License: MIT License
Instagram comment scraper using python and selenium. Save the comments into excel.
License: MIT License
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
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
When I run the code after a full set up it consistently states "Message: no such element: Unable to locate element: {"method":"css selector","selector":".MGdpg > button:nth-child(1)"}" Has this issue come up before? If so, is there a simple solve? I am afraid IG may have changed the CSS identifier for the load_more_comments button
Getting a TypeError while running the scrapper.py
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?
Would it be possible to enter the username and have it collect comments from all posts? How? Thankss
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
mas Agi, apakah scrapernya ada limitnya? saya scrap foto dengan 500 komentar tapi di komentar ke 10 sudah berhenti
I am getting stuck at login screen and the documentation doesn't really help at this point.
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
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.