Created
September 7, 2018 11:26
-
-
Save aalipar13/06a823a44f60c5efaa88ffccaf845940 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 json | |
import requests | |
from bs4 import BeautifulSoup | |
import sys | |
r = requests.get('https://www.instagram.com/kryzzzie/') | |
soup = BeautifulSoup(r.text, 'lxml') | |
script = soup.find('script', text=lambda t: t.startswith('window._sharedData')) | |
page_json = script.text.split(' = ', 1)[1].rstrip(';') | |
data = json.loads(page_json) | |
non_bmp_map = dict.fromkeys(range(0x10000, sys.maxunicode + 1), 0xfffd) | |
for post in data['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media']['edges']: | |
image_src = post['node']['display_url'] | |
print(image_src) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment