
增长黑客
Use Python to download reviews of a specific app on Google Play.
4/22/2023 · 1 min read
this code is update, Added rating, comment time, author reply, support for multiple apps
from google_play_scraper import Sort, reviews
import csv
import pandas as pd
def get_reviews(app_package_names):
writer = pd.ExcelWriter('reviews.xlsx', engine='xlsxwriter')
for app_package_name in app_package_names:
result, continuation_token = reviews(
app_package_name,
lang='en', # specify the language of the reviews
country='us', # specify the country of the reviews
sort=Sort.MOST_RELEVANT, # sort the reviews by relevance
count=5000, # number of reviews to retrieve
)
# save the result as a sheet in the xlsx file
if len(app_package_name) >= 31:
app_package_name = app_package_name[:30]
df = pd.DataFrame(result)
df.to_excel(writer, sheet_name=app_package_name, index=False)
writer.close() # save the writer object to save the file
app_package_names = ['com.bodyfast', 'de.fastic.app','bodyfast.zero.fastingtracker.weightloss','com.purplecover.anylist','com.apalon.to.do.list','com.callpod.android_apps.keeper','droom.sleepIfUCan','com.anydo','todolist.scheduleplanner.dailyplanner.todo.reminders'] # replace with the package names of the apps you want to download reviews for
get_reviews(app_package_names)