Scraping Shopee SG App Reviews from Google Play Store¶
Install Library¶
In [ ]:
%%capture
!pip install google_play_scraper
Import Library¶
In [ ]:
from google_play_scraper import Sort, reviews_all
import pandas as pd
Setup Base Directory¶
In [ ]:
from google.colab import drive
drive.mount('/content/drive')
Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount("/content/drive", force_remount=True).
In [ ]:
BaseDir = '/content/drive/MyDrive/Colab Notebooks/Sentiment-Analysis/'
Scraping¶
In [ ]:
scrapreview= reviews_all(
'com.shopee.sg', # ID aplikasi
lang='en', # defaults to ‘en’
country='sg', # defaults to ‘us’
sort = Sort.MOST_RELEVANT, # defaults to Sort.MOST_RELEVANT
filter_score_with=None # defaults to None (means all score)
)
In [ ]:
app_reviews_df = pd.DataFrame(scrapreview)
app_reviews_df
Out[ ]:
reviewId | userName | userImage | content | score | thumbsUpCount | reviewCreatedVersion | at | replyContent | repliedAt | appVersion | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | c5689c61-60cc-4e9b-b426-5c1982580aea | A Google user | https://play-lh.googleusercontent.com/EGemoI2N... | I wouldn't use this app again, at least for a ... | 1 | 109 | 2.54.16 | 2020-04-30 10:39:46 | Thank you for your review. We are sorry to hea... | 2020-04-30 12:25:06 | 2.54.16 |
1 | 28103537-a7f2-4748-ab09-00eae61061ed | A Google user | https://play-lh.googleusercontent.com/EGemoI2N... | The app is workng fine. The issue i had was th... | 1 | 536 | 2.91.31 | 2022-08-13 22:11:42 | Thank you for bringing this issue to our atten... | 2022-08-14 01:21:57 | 2.91.31 |
2 | 283217de-cf04-405d-99c5-bc48684c657f | A Google user | https://play-lh.googleusercontent.com/EGemoI2N... | Very bad service experience. Had requested not... | 1 | 185 | 2.77.07 | 2021-09-26 07:56:46 | Thank you for bringing this issue to our atten... | 2021-09-26 08:18:58 | 2.77.07 |
3 | 8b0b9d94-f765-49bf-9dd3-7611fe7355f0 | A Google user | https://play-lh.googleusercontent.com/EGemoI2N... | After recent updates last month, the app seems... | 1 | 97 | 2.81.21 | 2022-01-06 00:34:11 | Thank you for bringing this issue to our atten... | 2022-01-06 00:37:35 | 2.81.21 |
4 | 3ad9528c-d884-4581-997d-6c8fa7ef4ea5 | A Google user | https://play-lh.googleusercontent.com/EGemoI2N... | For the past one year I would have given a 5 s... | 1 | 179 | 2.71.16 | 2021-05-26 15:04:33 | Thank you for bringing this issue to our atten... | 2021-05-26 15:36:15 | 2.71.16 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
41683 | de20a36d-7a04-4ffe-aa53-b3ddaf8589cb | Ram Rachy | https://play-lh.googleusercontent.com/a/ACg8oc... | 👍 👍 👍 | 5 | 0 | None | 2021-06-26 04:44:52 | Thank you for giving Shopee a 5-star review! W... | 2021-06-26 06:14:50 | None |
41684 | 0d7896fe-0ec0-46c1-b63f-1e624d2e3ffe | A Google user | https://play-lh.googleusercontent.com/EGemoI2N... | ok.... | 5 | 0 | None | 2024-02-22 14:35:29 | Thank you for giving Shopee a 5-star review! W... | 2024-02-23 01:07:38 | None |
41685 | 6ff22a4e-993d-471b-97bf-ccd6f6d47b7c | Chocho Lay | https://play-lh.googleusercontent.com/a-/ALV-U... | 👍 | 1 | 0 | 2.95.59 | 2022-12-06 08:06:59 | Thank you for bringing this issue to our atten... | 2022-12-06 09:15:10 | 2.95.59 |
41686 | 8c549345-d48b-474a-ab8f-91f35e162f09 | A Google user | https://play-lh.googleusercontent.com/EGemoI2N... | 😓 | 1 | 0 | None | 2020-02-29 11:16:48 | None | NaT | None |
41687 | 8464d424-f3e6-4884-974a-9beef6b4bd80 | Dhillon Satnam | https://play-lh.googleusercontent.com/a-/ALV-U... | ❤️❤️ | 5 | 0 | None | 2023-09-13 11:06:07 | Thank you for giving Shopee a 5-star review! W... | 2023-09-13 12:59:44 | None |
41688 rows × 11 columns
In [ ]:
app_reviews_df.shape
Out[ ]:
(41688, 11)
Export dataset¶
In [ ]:
app_reviews_df.to_csv(BaseDir + 'dataset/shopee-en-sg-all.csv', index=None, header=True)
Reference:¶
Google Play Scraper https://pypi.org/project/google-play-scraper/