【发布时间】:2016-04-22 00:33:00
【问题描述】:
如何将我抓取的所有浮点数加起来?
for post in posts:
numberOfItems = numberOfItems + 1
print(numberOfItems)
value = float(re.sub(r"[^\d.]", "", post.text))
print("Chaos orbs: %s" % value)
print(value)
像这样 print(value1 + value2 + value3) 但是,这将是一个我不知道的随机数量,所以我不能制作变量
【问题讨论】:
-
你能举个
post.text的例子吗?或者至少确认您计算的value正在返回正确的结果?
标签: python python-2.7 python-3.x selenium