.find()
works the same way as you'd find other tags such as div
, p
and a
tags. Therefore, we search for the 'react' tag.
react_tag = soup.find('react')
Then, access the num
attribute like so.
num_value = react_tag['num']
Should print out:
2
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…