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

scrapeVehicles.py Not fully stripping the prices #1

Open
trepersec opened this issue Sep 27, 2021 · 0 comments
Open

scrapeVehicles.py Not fully stripping the prices #1

trepersec opened this issue Sep 27, 2021 · 0 comments

Comments

@trepersec
Copy link

TLDR; the price is being stripped of the dollar sign ($), but no the comma (,). e.g. $2,500 -> 2,500 = error

System: Ubuntu 18.04.5 LTS
Code/Commit Version: Jan 20, 2019

Thanks for making this available! Going through your docs and ran installed it according to instructions. Ran crawlCities.py and finished in 25 seconds. Went to run scrapeVehicles.py, but then it fails with the following error:

Scraping vehicles from [city], 29 cities remain
Gathering entries 0 through 120
0 entries tossed due to inadequate data
Traceback (most recent call last):
  File "scrapeVehicles.py", line 286, in <module>
    main()
  File "scrapeVehicles.py", line 282, in main
    runScraper()
  File "scrapeVehicles.py", line 110, in runScraper
    vehicleDict["price"] = int(item[1].strip("$"))
ValueError: invalid literal for int() with base 10: '2,500'

Suggested fix (or something along these lines because this allows me to run the code):
scrapeVehicles.py @ line 110
FROM : vehicleDict["price"] = int(item[1].strip("$"))
TO : vehicleDict["price"] = int(item[1].replace('$', '' ).replace(',', '' ))

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant