【爬虫2019,9月】携程eleven参数解密

携程:

url='https://hotels.ctrip.com/Domestic/Tool/AjaxHotelList.aspx'

1,经过多次postman,传入参数:page 为翻页的页数

for page in range(1,2):
    data={
        "StartTime":"2019-09-12",
        "DepTime":"2019-09-13",
        "RoomGuestCount":"1,1,0",
        "cityId":"2",
        "cityPY":"shanghai",
        "cityCode":"021",
        "cityLat":"31.2363508011",
        "cityLng":"121.4802384079",
        "page":page,
}

2,页面寻找到可以接口数据(就能爬取所有)

data = json.loads(rep.text)
dta=data['html']
dtaa=etree.HTML(dta)

【爬虫2019,9月】携程eleven参数解密_第1张图片【爬虫2019,9月】携程eleven参数解密_第2张图片

 

你可能感兴趣的:(Python爬虫)