JustAnotherArchivist / JustAnotherArchivist/snscrape

IndexError of Instagram

Open
#520 19 comments 0 reactions 0 assignees View on GitHub
bug module:instagram
Dominant language
Python
Stars
5.4k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

Hi, I want to use snscrape for collect instagram data. My code is:

```
import snscrape.modules.instagram as sninstagram
import pandas as pd

query='google' #change name
ins_s=[]
limit=10
for ins in sninstagram.InstagramHashtagScraper(query).get_items():
print(vars(ins))
break
```

And I got this error:

> jsonData = r.text.split('window._sharedData = ')[1].split(';')[0] # May throw an IndexError if Instagram changes something again; we just let that bubble.
IndexError: list index out of range

How can I fix it?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at InstagramHashtagScraper and inspect the response around the jsonData split shown in the report. Compare it with the current Instagram response, then verify that the provided hashtag query yields items without raising IndexError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.