chris-greening / instascrape

Powerful and flexible Instagram scraping library for Python, providing easy-to-use and expressive tools for accessing data programmatically
https://chris-greening.github.io/instascrape/
MIT License
625 stars 109 forks source link

fix get_recent_comments on selenium/requests.Session (Fixes #124) #126

Closed stefco closed 3 years ago

stefco commented 3 years ago

Description

Post.get_recent_comments would raise a KeyError when using Selenium or a requests.Session object to scrape a Post due to slight differences in the structure of the resulting json_dict. I added an except block to handle this and try the alternative json_dict schema.

Fixes #124

Checklist

Additional notes (optional)

Still need to write unit tests.

stefco commented 3 years ago

Moved this and several other suggested fixes to #125, easier to just track there.