Created
August 30, 2015 16:17
-
-
Save ywchiu/c12a2e4549b2451ea11c to your computer and use it in GitHub Desktop.
This file contains 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 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