如何從中提取「3200: - 」?從beautifulsoup中提取整數
<p class="list_price font-large" itemprop="price">3 200:-</p>
price = soup.find_all("p", {"class": "list_price font-large"}, {"itemprop": "price"})[0]
def get_price():
for integer in price:
return(integer)
print(get_price())
,並打印出3200我,但我如何能更有效地做到這一點?
有一個for循環回似乎不正確的投 –