嘿,我所遇到的一些困難,同時網絡爬行。我試圖獲得嵌入在一些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