Last active
April 15, 2019 10:32
-
-
Save svmihar/97727162be639fe72d8bec8292f23ddb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import json | |
import requests | |
url = 'https://www.tokopedia.com/reputationapp/review/api/v2/product/269922085?page=1&total=20' | |
kumpulan_url = [] | |
for i in range(1, 401): | |
kumpulan_url.append(f'https://www.tokopedia.com/reputationapp/review/api/v2/product/269922085?page={i}&total=20') | |
print(kumpulan_url) | |
for index, link in enumerate(kumpulan_url): | |
req = requests.get(link) | |
data_json = req.json() | |
with open(f'file{index}.json', 'w') as f: | |
json.dump(data_json['data']['list'], f) | |
# print() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment