Это мой код:
def check_price():
page = requests.get(URL, headers=headers)
soup = BeautifulSoup(page.content, 'html.parser')
title = soup.find(id="itemTitle").get_text()
price = soup.find(id="prcIsum").get_text()
converted_price = float(price[4:10])
converted_title = title[16:61]
if(converted_price < 31.950):
send_mail()
print(converted_title)
print(converted_price)
if(converted_price > 31.000):
send_mail()
Это ошибка, которую я получил
File "C:/Users/Mario/PycharmProjects/Bitanga/AI.py", line 55, in <module>
check_price()
File "C:/Users/Mario/PycharmProjects/Bitanga/AI.py", line 20, in check_price
converted_price = float(price[4:10])
ValueError: could not convert string to float: '31,950'