DrankRock / CMScrape

A simple python CardMarket price scraper.
17 stars 3 forks source link

If card is not available price is set to 0 #2

Closed ninox360 closed 1 year ago

ninox360 commented 1 year ago

When scraping a card that is not available some price parameters can be "None", which leads to an exception when converting string to float. This checks if price is "None" and returns 0 if true. for example (as of now): https://www.cardmarket.com/de/Pokemon/Products/Singles/Team-Rocket/Dark-Alakazam-V1-TR1?language=3&minCondition=2&isSigned=N&isAltered=N&isFirstEd=N

DrankRock commented 1 year ago

Hey,

Thank you for the pull request ! I misread my notification, I thought it was an issue instead of a pull request, I'm sorry ! I fixed it, and instead of just returning 0, I return "N/A" just like on CardMarket, and if the price is N/A, I don't add it to the total prices.

Would you prefer if I set it to 0 ?

ninox360 commented 1 year ago

Thanks! No it's cool I just wanted it to run without exception and this has done it for me

DrankRock commented 1 year ago

Alright, thanks for the interest, have a nice day!