JustAnotherArchivist / snscrape

A social networking service scraper in Python
GNU General Public License v3.0
4.4k stars 703 forks source link

Error scraping Instagram "Redirected to login page" #219

Closed ThomasPeetersKADOC closed 3 years ago

ThomasPeetersKADOC commented 3 years ago

Good afternoon,

I was getting ready to scrape some instagram accounts using snscrape version 0.3.5.dev96+g47fbc2a. While it showed no errors or problems while scraping twitter, I encountered the following message when trying to scrape instagram:

C:\Users\u0102607>snscrape instagram-user cdenv > cdenvetest.txt 2021-04-21 14:06:46.849 CRITICAL snscrape._cli Dumped stack and locals to C:\Users\u0102607\AppData\Local\Temp\snscrape_locals_kxovv6_w Traceback (most recent call last): File "C:\Users\u0102607\AppData\Local\Programs\Python\Python39\Scripts\snscrape-script.py", line 33, in <module> sys.exit(load_entry_point('snscrape==0.3.5.dev96+g47fbc2a', 'console_scripts', 'snscrape')()) File "c:\users\u0102607\appdata\local\programs\python\python39\lib\site-packages\snscrape\_cli.py", line 270, in main for i, item in enumerate(scraper.get_items(), start = 1): File "c:\users\u0102607\appdata\local\programs\python\python39\lib\site-packages\snscrape\modules\instagram.py", line 137, in get_items r = self._initial_page() File "c:\users\u0102607\appdata\local\programs\python\python39\lib\site-packages\snscrape\modules\instagram.py", line 111, in _initial_page raise snscrape.base.ScraperException('Redirected to login page') snscrape.base.ScraperException: Redirected to login page

The result is that while snscrape does create the desired .txt, said document is completely empty. It does so for all instagram pages and accounts I've tried. Mind you, this all happens when I'm already logged in.

Has facebook's redesigning spread to instagram creating these problems or am I doing something wrong?

JustAnotherArchivist commented 3 years ago

The Instagram scraper still works, but your IP got banned. See #165

okkymabruri commented 3 years ago

Yeah thanks, but how to handle change proxy/IP with snscrape @JustAnotherArchivist