python extracting photos from instagram post

Viewed 18

I have been trying to extract a photo from an Instagram post but to no avail. example post: https://www.instagram.com/p/ChIj3ukOtOQ/

By inspecting elements in chrome I can see that the photo can be extracted using BeautifulSoup (the image URL is embedded in ). However, when I use a get request on the URL, it returns a response that does not contain the image URL. this is what I have tried

import requests as rq
response = rq.get("https://www.instagram.com/p/CiNiO8oDcrl/")
print(response.text)

i'm suspecting this is because requests does not execute javascript? Any help would be greatly appreciated

0 Answers
Related