2
我一直跑到牆壁,但感覺就像我在這裏。美麗的湯:解析只有一個元素
HTML塊正在收穫:
div class="details">
<div class="price">
<h3>From</h3>
<strike data-round="true" data-currency="USD" data-price="148.00" title="US$148 ">€136</strike>
<span data-round="true" data-currency="USD" data-price="136.00" title="US$136 ">€125</span>
</div>
我想解析出 「US $ 136」 單獨值(跨度的數據)。這裏是我的邏輯,到目前爲止,這同時捕捉「期間數據」和「罷工數據:
price = item.find_all("div", {"class": "price"})
price_final = (price[0].text.strip()[8:])
print(price_final)
任何反饋表示讚賞:)
太好了,謝謝您的反饋。現在工作 –