You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to scrape using instagram module it gives the following error
Traceback (most recent call last):
File "D:\Github Contributions\snscrape\test.py", line 4, in <module>
for post in instagram.InstagramLocationScraper(locationId="110585945628334").get_items():
File "D:\Github Contributions\snscrape\snscrape\modules\instagram.py", line 163, in get_items
r = self._initial_page()
File "D:\Github Contributions\snscrape\snscrape\modules\instagram.py", line 130, in _initial_page
r = self._get(self._initialUrl, headers=self._headers, responseOkCallback=self._check_initial_page_callback)
File "D:\Github Contributions\snscrape\snscrape\base.py", line 266, in _get
return self._request('GET', *args, **kwargs)
File "D:\Github Contributions\snscrape\snscrape\base.py", line 237, in _request
success, msg = responseOkCallback(r)
File "D:\Github Contributions\snscrape\snscrape\modules\instagram.py", line 141, in _check_initial_page_callback
jsonData = r.text.split('<script type="text/javascript">window._sharedData = ')[1].split(';</script>')[
IndexError: list index out of range
How to reproduce
Can use any scraper from instagram module and same result will be shown.
Describe the bug
Trying to scrape using instagram module it gives the following error
How to reproduce
Can use any scraper from instagram module and same result will be shown.
Expected behaviour
Return Location Posts
Screenshots and recordings
No response
Operating system
WIndows 10
Python version: output of
python3 --version
3.9
snscrape version: output of
snscrape --version
snscrape 0.6.2.20230320
Scraper
instagram-location
How are you using snscrape?
CLI (
snscrape ...
as a command, e.g. in a terminal)Backtrace
No response
Log output
No response
Dump of locals
No response
Additional context
I checked the source code and apparently it was expected to happen sooner or later
May throw an IndexError if Instagram changes something again; we just let that bubble.
And now currently I'm unable to find it's replacement in source page.
I checked it manually and
entry_data
is empty dict there.maybe the _InstagramCommonScraper needs to be updated and use the API calls instead of scraping from the html source code?
The text was updated successfully, but these errors were encountered: