Skip to content

Instantly share code, notes, and snippets.

@svmihar
Last active April 15, 2019 10:32
Show Gist options
  • Save svmihar/97727162be639fe72d8bec8292f23ddb to your computer and use it in GitHub Desktop.
Save svmihar/97727162be639fe72d8bec8292f23ddb to your computer and use it in GitHub Desktop.
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