Error scrapping hashtags - Graphql KeyError
nansravn opened this issue · comments
When I execute this code:
from instagramy import InstagramHashTag
tag_latest = InstagramHashTag("my_hashtag", sessionid="my_session_id")
I receive the following error:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-1-bb45efb6917a> in <module>
1 from instagramy import InstagramHashTag
----> 2 tag_latest = InstagramHashTag("******", sessionid="4609********************")
C:\ProgramData\Miniconda3\envs\scrap38\lib\site-packages\instagramy\InstagramHashTag.py in __init__(self, tag, sessionid, from_cache)
58 data = self.get_json()
59 cache.make_cache(
---> 60 tag, data["entry_data"]["TagPage"][0]["graphql"]["hashtag"]
61 )
62 try:
KeyError: 'graphql'
Apparently this graphql
key doesn't exist inside the object data["entry_data"]["TagPage"][0]
.