Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing product price with currency symbol (€) #257

Open
CVasilakis opened this issue Jan 19, 2025 · 1 comment · Fixed by #258
Open

Error parsing product price with currency symbol (€) #257

CVasilakis opened this issue Jan 19, 2025 · 1 comment · Fixed by #258

Comments

@CVasilakis
Copy link

I tried to add an amazon product with the following:

python3 main.py -a -c smartphones -u https://www.amazon.de/-/en/Google-Pixel-Pro-Smartphone-Obsidian/dp/B0DG9DD9VN

which returned:

Product info is not valid - see logs for more info

The logfile has the following info:

2025-01-19 22:21:08,046 : INFO : scraper.add_product : Adding product with category 'smartphones' and url 'https://www.amazon.de/-/en/Google-Pixel-Pro-Smartphone-Obsidian/dp/B0DG9DD9VN'
2025-01-19 22:21:11,064 : ERROR : scraper.domains : Could not get all the data needed from url: https://www.amazon.de/-/en/Google-Pixel-Pro-Smartphone-Obsidian/dp/B0DG9DD9VN
Traceback (most recent call last):
  File "/home/user/amazon/scraper/scraper/domains.py", line 37, in get_product_info
    price = self._get_product_price()
            ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/amazon/scraper/scraper/domains.py", line 257, in _get_product_price
    return float(
           ^^^^^^
ValueError: could not convert string to float: '€1106.18'

To solve the issue i added replace("€", "") in line 257 of the domains.py, but shouldn't the script autodetect the currency?

@Crinibus
Copy link
Owner

Can you try to pull the latest commits from the master branch and see if that solves the issue with getting the price?

@Crinibus Crinibus reopened this Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants