S
S
Sergey Afanasiev2020-07-08 11:20:03
Python
Sergey Afanasiev, 2020-07-08 11:20:03

Libraries for working with instagram in Python?

Hello!
I want to parse photos from instagram from any link, as it turned out, ordinary BeautifulSoup is not enough, can someone suggest some libraries for this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2020-07-08
@keksss17

Library - InstaPy.
I do not know why BS did not please the truth.

import requests
import re

post_url = 'https://www.instagram.com/p/CBaXWGThA3s'
r = requests.get(post_url)
image_url = re.search(r'display_url":"(.+?)"', r.text).group(1).replace(r'\u0026', '&')

print(image_url)

D
Dmitry Link, 2020-07-08
@DmitryLink

Selenium as an option. And why BS was not enough?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question