[英]beautiful soup get value inside a tag / class
Referred to beautiful soup just get the value inside the tag , I've tried to transfer this code to my HTML tag (see below) but unfortunately, I couldn´t find a solution yet. 提到美丽的汤只是得到标签内的价值 ,我试图将此代码转移到我的HTML标签(见下文)但不幸的是,我还没有找到解决方案。 This is my HTML example: 这是我的HTML示例:
<div id="city" class="temperature">29</div>
I want to scrape the temperature value (= 29). 我想刮掉温度值(= 29)。 Any hints? 任何提示?
Thank you! 谢谢!
>>> soup
<div id="city" class="temperature">29</div>
>>> soup.div
<div id="city" class="temperature">29</div>
>>> soup.div.text
u'29'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.