S
S
Sofia S2021-02-05 16:02:38
Python
Sofia S, 2021-02-05 16:02:38

How to pull text from a div that has a class in front of the text we need?

<div><span class="some class"> Меня не трогай </span> А меня вытащи </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-02-05
@SoreMix

span = soup.find('span', {'class': 'some class'})

print(span.next_sibling)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question