title: ValueError in webscraper: could not convert string to float: '\n €203,88€'
body: <p>Im trying to make a price alert, every time the price of my desired product drops below 190. I get an email. Problem is, there seems to be an issue with my <code>if(converted_price &lt; 190): </code>. It also gives the message that the () are redundant, but if I remove them, the error message doesn't go away. Im following a YouTube tutorial, and doing everything exactly like it is being done. in the video, but still getting an error. This is my full code + Output:</p>
  <pre><code>from bs4 import BeautifulSoup
  import smtplib
  
  URL = 'https://www.amazon.nl/Diadora-DT-FORTY-Tapis-magneetloopband/dp/B00NM8ECHY/ref=sr_1_1?__mk_nl_NL=%C3%85M%C3%85' \
        '%C5%BD%C3%95%C3%91&amp;crid=33LL286IOOEZX&amp;keywords=diadora+dt-forty&amp;qid=1655247701&amp;sprefix=diadora+dt-forty%2Caps' \
        '%2C68&amp;sr=8-1 '
  
  headers = {&quot;User-Agent&quot;: 'MYUSERAGENT '
                           'Chrome/102.0.0.0 Safari/537.36 '}
  
  
  def check_price():
  
      page = requests.get(URL, headers=headers)
  
      soup = BeautifulSoup(page.content, 'html.parser')
  
      title = soup.find(id=&quot;productTitle&quot;).get_text()
      price = soup.find(id=&quot;corePrice_feature_div&quot;).get_text()
      converted_price = float(price[0:10])
  
      if(converted_price &lt; 190):
          send_mail()
  
      print(converted_price)
      print(title.strip())
  
      if(converted_price &lt; 190):
          send_mail()
  
  
  def send_mail():
      server = smtplib.SMTP('smtp.gmail.com', 587)
      server.ehlo()
      server.starttls()
      server.ehlo()
  
      server.login('MYEMAIL', 'MYPASSWORD')
  
      subject = 'price drop!'
      body = 'Check the link https://www.amazon.nl/Diadora-DT-FORTY-Tapis-magneetloopband/dp/' \
             'B00NM8ECHY/ref=sr_1_1?__mk_nl_NL=%C3%85M%C3%85%C5%BD%C3%95%C3%91&amp;crid=33LL286IOOEZX&amp;' \
             'keywords=diadora+dt-forty&amp;qid=1655247701&amp;sprefix=diadora+dt-forty%2Caps%2C68&amp;sr=8-1'
  
      msg = f&quot;Subject: {subject}\n\n{body}&quot;
  
      server.sendmail(
          'MYEMAIL',
          'MYEMAIL',
          msg
      )
      print('Email has been sent')
  
      server.quit()
  
  
  check_price() ```
  
  **OUPUT**
  Traceback (most recent call last):
    File &quot;/Users/julia/PycharmProjects/pythonProject2/pdf.py&quot;, line 58, in &lt;module&gt;
      check_price()
    File &quot;/Users/julia/PycharmProjects/pythonProject2/pdf.py&quot;, line 21, in check_price
      converted_price = float(price[0:10])
  ValueError: could not convert string to float: '\n €203,88€'
  
  
  
  
  
  </code></pre>