Python notes-BeautifulSoup gets element information by looking up Id

For example, the following html

He is under the span tag class name, id is-like-span

In this way, the method can be carried out by such code:

isCliked = soup.find('span', id = 'is-like-span'

You can get it in this way. If it is a string, you can call get_text ().

1341 original articles were published · 10,000 + praises · 4.34 million + views

Guess you like

Origin blog.csdn.net/qq78442761/article/details/105609885