We Are Trying from Instagram Importing Instagramy from Python but It's Not Working
I Want to Scrape the Data from Instagram Different Public and Private Accounts. but When I Run the Following Code. from Instagramy Import Instagram #...
I want to scrape the data from Instagram different public and private accounts. But when I run the following code.
from instagramy import Instagram
# Connecting the profile
user = Instagram("ihtishamKhattak")
# printing the basic details like
# followers, following, bio
print(user.is_verified())
print(user.popularity())
print(user.get_biography())
# return list of dicts
posts = user.get_posts_details()
print('\n\nLikes', 'Comments')
for post in posts:
likes = post["likes"]
comments = post["comment"]
print(likes,comments)
2 Answers
You can have a look at the instagramy pypi page.
There is no Instagram python module. Also make sure, that you have no script calles instagramy.py
change your script to
from instagramy import InstagramUser
# Connecting the profile
user = InstagramUser("ihtishamKhattak")
Beware that this might work only for few request if you do not provide a Session ID.