Created
August 6, 2019 08:23
-
-
Save atao/dceeb08612da8f02b4ec6d55659e257a to your computer and use it in GitHub Desktop.
Get number of instagram followers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
username = "UserProfile" | |
try: | |
r = requests.get('https://www.instagram.com/'+username) | |
followers = re.findall( r'userInteractionCount":"(\d*)"', r.text) | |
user = re.findall( r'alternateName":"@(\w+)', r.text) | |
print("@"+ user[0], ":", followers[0], "followers") | |
except: | |
print("Instagram Error") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment