Skip to content

Instantly share code, notes, and snippets.

@ywchiu
Created August 30, 2015 16:17
Show Gist options
  • Save ywchiu/c12a2e4549b2451ea11c to your computer and use it in GitHub Desktop.
Save ywchiu/c12a2e4549b2451ea11c to your computer and use it in GitHub Desktop.
import requests
import json
import math
n = 963
pages = int(math.ceil(float(n)/10))
for page in range(1, pages+1):
res = requests.get('http://www.agoda.com/api/zh-tw/Main/GetReviewComments?HotelId=908412&travellerTypeId=0&pageSize=10&pageNo={}&sortingOption=1'.format(page))
jd = json.loads(res.text)
for review in json.loads(res.text)['Comments']:
print review['ReviewTitle']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment