我不知道我的代码有什么问题:
def check_Price():
title = soup.find(id="productTitle").get_text()
price = soup.find(id="priceblock_ourprice").get_text()
converted_price=float(price[2:8])
if(converted_price>42,999):
send_mail()
)
运行此代码后,会出现以下错误:
converted_price=float(price[2:8])
ValueError: could not convert string to float: '42,999'
要转换为float,字符串中只能有数字,最多只能有一个“.”。您可以使用下面的一个或使其更通用
相关问题 更多 >
编程相关推荐