M
M
Maxim Rybka2021-05-06 20:50:29
Python
Maxim Rybka, 2021-05-06 20:50:29

How to refer to div without attributes?

There is a parent div with a class, in this div there is another div without a single attribute, and in it there is another div whose only attribute is style, how do I access the last div and get its contents using selenium or beautiful soup?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yupiter7575, 2021-05-06
@yupiter7575

div = soup.find(attrs={'class':'class_div'})
div2 = div.find('div')
div3 = div2.find('div')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question