python-3.x - 无法通过发布请求使用网址“https://play.google.com/store/getreviews”来抓取 google play 评论
问题描述
我尝试了互联网上所有可用的代码来抓取 google playstore。网址“ https://play.google.com/store/getreviews ”工作了 1 天。它现在不工作。我收到 404 错误。
请帮忙
解决方案
您可以尝试使用 SerpApi 等第三方解决方案。我们为您处理代理、解决验证码并解析所有丰富的结构化数据。
使用此 API,您每页最多可以检索 199 条评论,然后用于next_page_token
获取其余评论。
用于检索 YouTube 评论的示例 python 代码(也可在其他库中获得):
from serpapi import GoogleSearch
params = {
"api_key": "SECRET_API_KEY",
"engine": "google_play_product",
"store": "apps",
"gl": "us",
"product_id": "com.google.android.youtube",
"all_reviews": "true"
}
search = GoogleSearch(params)
results = search.get_dict()
示例 JSON 输出:
"reviews": [
{
"title": "Qwerty Jones",
"avatar": "https://play-lh.googleusercontent.com/a/AATXAJwSQC_a0OIQqkAkzuw8nAxt4vrVBgvkmwoSiEZ3=mo",
"rating": 3,
"snippet": "Overall a great app. Lots of videos to see, look at shorts, learn hacks, etc. However, every time I want to go on the app, it says I need to update the game and that it's \"not the current version\". I've done it about 3 times now, and it's starting to get ridiculous. It could just be my device, but try to update me if you have any clue how to fix this. Thanks :)",
"likes": 586,
"date": "November 26, 2021"
},
{
"title": "matthew baxter",
"avatar": "https://play-lh.googleusercontent.com/a/AATXAJy9NbOSrGscHXhJu8wmwBvR4iD-BiApImKfD2RN=mo",
"rating": 1,
"snippet": "App is broken, every video shows no dislikes even after I hit the button. I've tested this with multiple videos and now my recommended is all messed up because of it. The ads are longer than the videos that I'm trying to watch and there is always a second ad after the first one. This app seriously sucks. I would not recommend this app to anyone.",
"likes": 352,
"date": "November 28, 2021"
},
{
"title": "Operation Blackout",
"avatar": "https://play-lh.googleusercontent.com/a-/AOh14GjMRxVZafTAmwYA5xtamcfQbp0-rUWFRx_JzQML",
"rating": 2,
"snippet": "YouTube used to be great, but now theyve made questionable and arguably stupid decisions that have effectively ruined the platform. For instance, you now have the grand chance of getting 30 seconds of unskipable ad time before the start of a video (or even in the middle of it)! This happens so frequently that its actually a feasible option to buy an ad blocker just for YouTube itself... In correlation with this, YouTube is so sensitive twords the public they decided to remove dislikes. Why????",
"likes": 370,
"date": "November 24, 2021"
},
...
],
"serpapi_pagination": {
"next": "https://serpapi.com/search.json?all_reviews=true&engine=google_play_product&gl=us&hl=en&next_page_token=CpEBCo4BKmgKR_8AwEEujFG0VLQA___-9zuazVT_jmsbmJ6WnsXPz8_Pz8_PxsfJx5vJns3Gxc7FiZLFxsrLysnHx8rIx87Mx8nNzsnLyv_-ECghlTCOpBLShpdQAFoLCZiJujt_EovhEANgmOjCATIiCiAKHmFuZHJvaWRfaGVscGZ1bG5lc3NfcXNjb3JlX3YyYQ&product_id=com.google.android.youtube&store=apps",
"next_page_token": "CpEBCo4BKmgKR_8AwEEujFG0VLQA___-9zuazVT_jmsbmJ6WnsXPz8_Pz8_PxsfJx5vJns3Gxc7FiZLFxsrLysnHx8rIx87Mx8nNzsnLyv_-ECghlTCOpBLShpdQAFoLCZiJujt_EovhEANgmOjCATIiCiAKHmFuZHJvaWRfaGVscGZ1bG5lc3NfcXNjb3JlX3YyYQ"
}
查看文档以获取更多详细信息。
在操场上实时测试搜索。
免责声明:我在 SerpApi 工作。
推荐阅读
- c# - 如何从 C# 中的嵌套 json 中获取数据
- python - 如何使用子进程 python 发送 CTRL+D 击键
- python - 使用 --alluredir 执行测试并在功能中使用示例时 allure-pytest-bdd 中的 KeyError
- node.js - 是否可以在一个项目中使用不同的节点版本
- reactjs - 如何仅独立操作数组映射中的一项
- firebase - 无法从 Flutter 应用程序中的 Firebase 实时数据库中检索数据
- next.js - TypeError:升级到 Nextjs 11 后无法读取未定义的属性“forEach”
- sql - SQL:获取每次值更改时都会增加的行号
- internationalization - 尽管浏览器有另一种语言,Server Next js 会自动重定向到英文
- java - 如何解决 NullPointer 异常