简体   繁体   English

Python请求:requests.get在有效网址上返回404

[英]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. 我正在尝试使用请求API从python的Google Play商店中获取类似于应用程序的应用程序。

This returns a happy 200: 这将返回一个快乐的200:

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

This returns a 404: 这将返回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? 最后一个请求会为Chrome和邮递员生成一个有效的网址,如何为类似的应用程序创建一个有效的请求?

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. 为了使事情变得更有趣,正在我的终端中对其进行测试,它连续两次工作,然后返回404。

Solved it by using the answer here https://stackoverflow.com/a/13854790/4658520 通过在这里使用答案来解决它https://stackoverflow.com/a/13854790/4658520

Issue was using session, not HttpAuth 问题是使用会话,而不是HttpAuth

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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