gpt4 book ai didi

android - 抓取 Google Play 商店

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:47:35 24 4
gpt4 key购买 nike

我想抓取 Google Play 商店以下载所有 android 应用程序的网页(所有具有以下基本 url 的网页:https://play.google.com/store/apps/)。我检查了 play 商店的 robots.txt 文件,它不允许抓取这些 URL。

此外,当我浏览 Google Play 商店时,我只能看到每个类别最多 3 页的热门应用程序。如何获取其他应用程序页面?

如果有人尝试抓取 Google Play,请告诉我以下事项:a) 你是否成功地抓取了 Play 商店。如果是,请告诉我你是怎么做到的。b) 如何抓取每个类别的热门应用程序中不可见的隐藏应用程序页面?c) 是否有一种技术不仅可以下载网页,还可以下载应用程序?

我已经四处搜索并找到了以下链接:

a) https://code.google.com/p/android-market-api/ 
b) https://code.google.com/p/android-marketplace-crawler/source/checkout
c) http://mohsin-junaid.blogspot.co.uk/2012/12/how-to-install-android-marketplace.html
d) http://mohsin-junaid.blogspot.in/2012/12/how-to-download-multiple-android-apks.html

谢谢!

最佳答案

首先,Google Play 的 robots.txt不会禁止带有基本“/store/apps”的页面。

如果您想抓取 Google Play,您需要开发自己的网络抓取工具、解析 HTML 页面并提取您需要的应​​用元数据(例如标题、描述、价格等)。此主题已包含在其他 question 中.有一些库可以帮助解决这个问题,例如:

更难的部分是“找到”要抓取的应用程序页面。您可以使用 1) Google Play Sitemap或 2) 按照在 Link Extractor 中解释的在您抓取的每个页面中找到的应用程序链接进行操作文档(如果您打算使用 Scrapy)。

另一种选择是使用基于 ProtoBuf 的开源库来获取有关应用程序的元数据,这里是项目链接:https://code.google.com/archive/p/android-market-api .该库代表有效的 Google 帐户从 Google Play 获取应用程序元数据,但在这种情况下,您还需要一个爬虫来“查找”哪些应用程序可用并安排它们的元数据检索。这个另一个开源项目可以帮助你:https://code.google.com/archive/p/android-marketplace-crawler .

如果您不想自己实现所有这些,您可以使用第三方托管服务通过基于 JSON 的 API 访问 Android 应用元数据。例如,42matters.com (我工作的公司)为 Android 和 iOS 提供了一个 API 来检索应用程序的元数据,这里有更多详细信息:

https://42matters.com/app-market-data

为了获取应用程序的标题、图标、描述和下载,您可以使用此处记录的“查找”端点:

https://42matters.com/docs/app-market-data/android/apps/lookup

这是“Angry Birds Space Premium”应用的 JSON 响应示例:

{
"package_name": "com.rovio.angrybirdsspace.premium",
"title": "Angry Birds Space Premium",
"description": "Play over 300 interstellar levels across 10 planets...",
"short_desc": "The #1 mobile game of all time blasts off into space!",
"rating": 4.3046236038208,
"category": "Arcade",
"cat_key": "GAME_ARCADE",
"cat_keys": [
"GAME_ARCADE",
"GAME",
"FAMILY_EDUCATION",
"FAMILY"
],
"price": "$1.15",
"downloads": "1,000,000 - 5,000,000",
"version": "2.2.1",
"content_rating": "Everyone",
"promo_video": "https://www.youtube.com/embed/g6AL9YqRHaI?ps=play&vq=large&rel=0&autohide=1&showinfo=0&autoplay=1",
"market_update": "2015-07-03T00:00:00+00:00",
"screenshots": [
"https://lh3.googleusercontent.com/ZmuBQzIy1G74coPrQ1R7fCeKdJmjTdpJhNrIHBOaFyM0N2EYdUPwZaQjnQUtiUDGmac=h310",
"https://lh3.googleusercontent.com/Xg2Aq70ZH0SnNhtSKH7xg9jCfisWgmmq3C7xQbx6YMhTVAIRqlRJeH8GYtjxapb_qR4=h310",
"https://lh3.googleusercontent.com/T4o5-2_UP82sj4fSSegbjrGmslNHlfvtEYuZacXMSOC55-7eyiKySw05lNF1QQGO2FeU=h310",
"https://lh3.googleusercontent.com/f2ennaLdivFu5cQQaVPKsRcWxB8FS5T4Bkoy3l0iPW9-GDDnTVRhvR5kz6l4m8FL1c8=h310",
"https://lh3.googleusercontent.com/H-9M03_-O9Df1nHr2-rUdjtk2aeBY3bAxnqSX3m2zh_aV8-K1t0qU1DxLXnK0GrDAw=h310"
],
"created": "2012-03-22T08:24:00+00:00",
"developer": "Rovio Entertainment Ltd.",
"number_ratings": 20812,
"price_currency": "$",
"icon": "https://lh3.ggpht.com/aQaIEGrmba1ENSEgUtArdm3yhJUug7BRWlu_WaspoJusZyHv1rjlWtYqe_qRjE_Kmh1E=w300",
"icon_72": "https://lh3.ggpht.com/aQaIEGrmba1ENSEgUtArdm3yhJUug7BRWlu_WaspoJusZyHv1rjlWtYqe_qRjE_Kmh1E=w72",
"market_url": "https://play.google.com/store/apps/details?id=com.rovio.angrybirdsspace.premium&referrer=utm_source%3D42matters.com%26utm_medium%3Dapi"
}

希望对您有所帮助,否则请随时与我联系。我非常了解这个主题,可以为您指明正确的方向。

问候,

安德里亚

关于android - 抓取 Google Play 商店,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17002181/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com