drawrowfly / instagram-scraper

Instagram Scraper. Scrape useful data/posts from instagram users, hashtag and locations pages. Comments and people who liked specific posts and soon more. No login or API keys are required
582 stars 63 forks source link

IndexError: list index out of range #44

Closed radoya closed 3 years ago

radoya commented 3 years ago

Hi there.

I am trying to get this script up on Debian / Python3.9 but this is what error I am geting from this simple example:

from instascrape import Profile 
profile = Profile('chris_greening')
profile.scrape()
/home/username/.local/lib/python3.7/site-packages/instascrape/core/_static_scraper.py:136: MissingCookiesWarning: Request header does not contain cookies! It's recommended you pass at least a valid sessionid otherwise Instagram will likely redirect you to their login page.
  MissingCookiesWarning
Traceback (most recent call last):
  File "sample.py", line 3, in <module>
    profile.scrape()
  File "/home/radoya/.local/lib/python3.7/site-packages/instascrape/core/_static_scraper.py", line 144, in scrape
    return_data = self._get_json_from_source(self.source, headers=headers, session=session)
  File "/home/radoya/.local/lib/python3.7/site-packages/instascrape/core/_static_scraper.py", line 264, in _get_json_from_source
    json_dict = json_dict_arr[1]
IndexError: list index out of range

Any idea how to get this script work? Thanks.

drawrowfly commented 3 years ago

Not a python package

radoya commented 3 years ago

What I have to do to make it work? To install some package?

radoya commented 3 years ago

Sorry.. My fault :(

microphiber commented 3 years ago

i'm getting the same error. did you find any solutions ?

radoya commented 3 years ago

I have used instascrape not instagram-scraper. If you are using instascrape you probably missing valid Instagram SessionID.