T
T
Themidis Koudes2021-08-16 18:57:05
Python
Themidis Koudes, 2021-08-16 18:57:05

Why doesn't BeautifulSoup.find_all() return all elements on the page that meet the condition?

I decided to write a program that downloads all photos from an album in Odnoklassniki (I did not find utilities that would have such a function), so I decided to just parse the album page, get links to the original image files and download. But using the find_all method returns only the first 4 photos, and omits the rest (or does not see them). All photos meet the search criteria.

resp = req.get(Start_url)
soup = BeautifulSoup(resp.text, 'html.parser')
lst = soup.find_all('a', class_="photo-card_cnt")
print(len(lst), lst)


Also tried lxml parser

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2021-08-16
@Femid

So they are not in the body of the page. CTRL + U press and see what data is on the page

A
alexbprofit, 2021-08-16
@alexbprofit

selenium

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question