如何从此给定的HTML解析树中提取数值($ 54,857.85)?
我一直在尝试使用Python Beautifulsoup学习网络刮擦。但是,我在代码上遇到了一些麻烦,因为它不允许我简单地使用此代码访问此值:
value = doc.find_all(class_="bg-theme-p-4 whitespace-nowrap text-sm text-theme-text")
print(value)
lest.text基本上是我通过请求模块访问的HTML地址。
打印(值)条目不返回任何内容,而是打印出结果[]。 如何访问具有上述类的所有相关值?
I've been trying to learn web scraping using Python BeautifulSoup. However, I'm running into some trouble with my code, as it does not allow me to simply access this value using this code:
value = doc.find_all(class_="bg-theme-p-4 whitespace-nowrap text-sm text-theme-text")
print(value)
This is the html tree image of interest
where result.text is basically the html address that I have accessed through requests module.
The print(value) entry doesn't return anything, instead prints out the result [].
How can i access all the relevant values which have the class as written above?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用剥离式属性属性:;
Use stripped_strings property:;