thefakequake / pypartpicker

A Python package that can be used to fetch information from PCPartPicker on products and parts lists.
MIT License
18 stars 8 forks source link

Issue scraping prices #17

Closed mxnhera3 closed 7 months ago

mxnhera3 commented 7 months ago

Searching for prices using the following code

from pypartpicker import Scraper

# creates the scraper object
pcpp = Scraper()
# returns a list of Part objects we can iterate through
print ("Including entries without prices")
parts = pcpp.part_search("AMD Ryzen", region="uk")

# iterates through every part object
for part in parts:
    # prints the name and price of the part
    print(part.name)
    print(part.price)  

print("Excluding entries without prices")
for part in parts:
    if part.price is not None:
        # prints the name and price of the part
        print(part.name)
        print(part.price)

Yields the following results image

But upon checking the results for the same search on pcpp, you can see that many of these cpus do have prices image

Am I missing something or are the prices not being scraped correctly?

thefakequake commented 7 months ago

18 also has problems scraping, appears like the PCPP HTML structure changed. I will push out an update soon to fix both problems.

thefakequake commented 7 months ago

Fixed with version 1.9.5

mxnhera3 commented 7 months ago

Fixed my issue perfectly, Thank you!