【发布时间】:2015-11-19 15:26:13
【问题描述】:
我试图从我成功完成的网页中抓取一些价格
prices = item.find_all("span", {"class": "price"})
for price in prices:
price_end = price.text.strip().replace(",","")[2:]
print(price_end)
输出是:
13
36
50
65
12
52
60
85
因此,我总共有 8 个价格。我的问题是,如何使用 Python 自动计算输出中的价格?
我用 len 试过了,但它只是给了我相应数字的长度。
这似乎是直截了当的,但我总是撞墙。
你们能帮帮我吗?感谢您提供任何反馈。
【问题讨论】:
标签: python python-3.x web-crawler output