嘿,我所遇到的一些困难,同时网络爬行。我试图获得嵌入在一些html中间的代码块中的70,我的问题是我将如何去做这件事。我尝试了各种方法,但似乎没有工作。我正在使用BeautifulSoup模块并使用Python 3编写。如果有人需要它,链接到我正在抓取的网站的链接方便的链接。感谢您提前。如何检索一个href标签内的数据
<a href="http://www.accuweather.com/en/gb/london/ec4a-2/weather- forecast/328328">London, United Kingdom<span class="temp">70°</span><span class="icon i-33-s"></span></a>
from bs4 import*
import requests
data = requests.get("http://www.accuweather.com/en/gb/london/ec4a-2/weather- forecast/328328")
soup = BeautifulSoup(data.text,"html.parser")
感谢您的评论!但打印出所有的链接,即时通讯试图获得“70”的标签 – goimpress