marvinody / mercari

a wrapper around mercari jp shopping site
43 stars 15 forks source link

error 403 occurs when requesting the search api.Has the mercari add a validation step? #30

Open jerryfat7 opened 3 months ago

jerryfat7 commented 3 months ago

File "e:\爬虫\Crawler\crawlers\mercari.py", line 201, in fetch r.raise_for_status() File "C:\Users\jerryfatHome\anaconda3\envs\py39Crawler\lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.mercari.jp/v2/entities:search

marvinody commented 3 months ago

I have no issue running this locally still. My other version in Javascript also is running without issue so I think you may have some network issues or misconfigurations. I would recommend trying it from a different connection (use a VPN maybe?) to see if your network or IP is getting blocked by cloudflare or mercari themselves.

jerryfat7 commented 3 months ago

I have no issue running this locally still. My other version in Javascript also is running without issue so I think you may have some network issues or misconfigurations. I would recommend trying it from a different connection (use a VPN maybe?) to see if your network or IP is getting blocked by cloudflare or mercari themselves.

This error occurs exactly when I was using a VPN and I have tried different servers but none worked. Still I could visit mercari with chrome, maybe i should try other methods to see if it could work