Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.9k views
in Technique[技术] by (71.8m points)

帮们看看这个页面如何提取内容?

帮忙看看这个页面,我想提取10和2这两个数字,是在下面的,但是里面是data-class,我使用beautifulsoup的要怎么选取呢?或者用其他解析器也可以,谢谢
image


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

希望可以帮助到你。

const domAll = document.querySelectorAll('.article-bar em')
domAll[0].innerText
domAll[1].innerText

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...