我试图使用python请求访问URL。但是使用requests.get
时的结果与浏览器中显示的结果不同。浏览器显示酒店房价列表,但requests.get
显示:
'未找到任何结果'。
import requests
url = 'https://m.ihg.com/hotels/ihg/us/en/searchresults?destination=Atlanta%2C+GA%2C+United+States&checkInDay=01&checkInMonthYear=12016&checkOutDay=02&checkOutMonthYear=12016&rateCode=IMGOV&numberOfRooms=1&numberOfAdults=1&numberOfChildren=0&lat=33.748901&lng=-84.3881&corporateNumber=&installationCode=&travelType=&officialType=&dvqBranch=&dvqRank=&installationName='
headers = {'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25'}
response = requests.get(url)
response.text