S
S
Sergey Afanasiev2020-07-11 00:24:31
Python
Sergey Afanasiev, 2020-07-11 00:24:31

How to parse instagram image link using bs4?

Hello!
I want to parse the image link from instagram, but something is wrong in the skin, help me figure it out ..

import requests
from bs4 import BeautifulSoup as BS

URL = 'https://www.instagram.com/p/CCePpcWMg3I/'

r = requests.get(URL)
soup = BS(r.content, 'html.parser')

items = soup.find_all('div',class_='KL4Bh')
for x in items:
    link = x.find('src', class_='FFVAD')
    print(link)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-07-11
@SoreMix

The KL4Bh class is not in the page code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question