Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

get_recent_comments() results in KeyError: 'entry_data' #124

Open
agostini335 opened this issue Jun 14, 2021 · 6 comments · May be fixed by #125
Open

get_recent_comments() results in KeyError: 'entry_data' #124

agostini335 opened this issue Jun 14, 2021 · 6 comments · May be fixed by #125

Comments

@agostini335
Copy link

Describe the bug
calling get_recent_comments from a scraped post results in keyerror: 'entry_data'

headers = {"user-agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Mobile Safari/537.36 Edg/87.0.664.57",
"cookie": f"sessionid={SESSIONID};"}

path = "https://www.instagram.com/p/"+s['shortcode']+"/"
p = Post(path)
p.scrape(headers=headers)
->> error here print(p.get_recent_comments())

Expected behavior
I expect the list of comments of a post

@stefco
Copy link

stefco commented Jun 19, 2021

Did you use Selenium or a requests.Session? The json_dict is structured differently in those cases. I made a patch that fixes those cases, will submit in a second.

@NishantPuri99
Copy link

Hi @stefco ,
Has this update been merged yet?

If not, could you tell me how to work around this issue?
Thanks

@stefco
Copy link

stefco commented Aug 7, 2021

@NishantPuri99 It is not merged yet, have not seen feedback on #125. Seems the repository owner is not maintaining this project. I fixed it in the latest version on my fork's master branch, if you want to pip install that instead of the official release. Last time I tested, this worked.

@NishantPuri99
Copy link

Ah okay. Thank you so much
I'll use that then.

@takweb12
Copy link

hi
how can we get all comments in a post ?
this method just got first page not alll

@vahidsabet
Copy link

hi how can we get all comments in a post ? this method just got first page not alll

Same question

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants