简体   繁体   中英

Python requests: requests.get returns 404 on valid url

I am trying to get apps which are similar to an app from the Google Play Store in python, using the requests API.

This returns a happy 200:

payload = {"id":"apk_name"}
requests.get("https://play.google.com/store/apps/details", params = payload) 

This returns a 404:

requests.get("http://play.google.com/store/apps/similar", params = payload)

The last request produces a valid url for both Chrome and postman, how could I create a valid request for similar apps?

To make matters more interesting, was testing this in my terminal, it worked twice in a row, then went back to replying with a 404.

Solved it by using the answer here https://stackoverflow.com/a/13854790/4658520

Issue was using session, not HttpAuth

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM