Closed not-NEKO closed 1 year ago
Information about my computer maybe:
OS: Arch linux Python: 3.10.9
everything was working fine at the beggining but it stopped working at a moment i don't know why. Maybe because pcpartpicker black listed me? Other scrapers seem to work so i don't think.
nevermind it's my fault
What was your problem? I don't know if I'm stupid, but I'm getting the same error.
Essentially, it means that your request to PCPartPicker got blocked. All pages on PCPP as far as I can tell have this element:
If the object is None, then your request didn't go through.
To fix this, use custom request headers with your request so that you can act more like a browser, pass the headers
argument when you instantiate Scraper().
Thanks. For anyone looking into this, I had to specify both cookie and user-agent for it to work. You will find these values by right clicking on pcpartpicker.com and inspecting -> network tab -> possibly reloading the page -> choose name pcpartpicker.com -> scroll down to Request Headers -> copy both values
pcpp = Scraper(headers={ "cookie": "your cookie", "user-agent": "your user-agent" })
I tried to reinstall with pip but nothing changed
Input: from pypartpicker import Scraper Scraper().part_search("i5") Output: