py每日spider案例之某website之token参数定位
require('./env')
require('./loader')
e={
"mode": 0,
"Head": {
"extension": {
"LowPriceSource": "searchForm",
"Flt_BatchId": "8b44e66f-61ce-480b-94b0-142aad90dc77",
"BlockTokenTimeout": "0",
"full_link_time_scene": "pure_list_page",
"xproduct": "baggage"
}
},
"searchCriteria": {
"grade": 3,
"realGrade": 1,
"tripType": 2,
"journeyNo": 1,
"passengerInfoType": {
"adultCount": 1,
"childCount": 0,
"infantCount": 0
},
"journeyInfoTypes": [
{
"journeyNo": 1,
"departDate": "2025-08-29",
"departCode": "LAX",
"arriveCode": "NYC",
"departAirport": "",
"arriveAirport": ""
},
{
"journeyNo": 2,
"departDate": "2025-09-01",
"departCode": "NYC",
"arriveCode": "LAX",
"departAirport": "",
"arriveAirport": ""
}
],
"policyId": null
},
"sortInfoType": {
"direction": true,
"orderBy": "Direct",
"topList": []
},
"tagList": [],
"flagList": [
"NEED_RESET_SORT"
],
"filterType": {
"filterFlagTypes": [],
"queryItemSettings": [],
"studentsSelectedStatus": true
},
"abtList": [
{
"abCode": "240509_IBU_RFUO",
"abVersion": "A"
},
{
"abCode": "250811_IBU_wjrankol",
"abVersion": "A"
},
{
"abCode": "250806_IBU_FiltersOpt",
"abVersion": "B"
}
]
}
res=window.signature(e)
console.log(res)
补环境参数:
window=global;
window.Groza=''
window.HTMLCanvasElement=function(){
return 'function HTMLCanvasElement() { [native code] }'
};
window.screen={
availHeight:816,
availLeft: 0,
availTop: 0,
availWidth: 1536,
colorDepth: 24,
height: 864,
isExtended: false,
}
navigator={
appCodeName: "Mozilla",
appName: "Netscape",
appVersion: "5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36",
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
}
CanvasRenderingContext2D={
toString:function (){
return 'function CanvasRenderingContext2D() { [native code] }'
}
}
_canvas={
getContext:function (params){
console.log("canvas getContext>>", params);
if(ctx==="2d"){
console.log("获取2d画布")
return CanvasRenderingContext2D
}
}
}
document={
createElement: function(tagName) {
console.log("documnet createElement>>>", tagName);
if(tagName==='canvas'){
return _canvas
}
},
cookie:`GUID=09034025115463052623; IBU_FLIGHT_LIST_STYLE=Separate; ibulanguage=EN; ibulocale=en_us; cookiePricesDisplayed=USD; ibu_country=US; ibu_cookie_strict=0; _abtest_userid=ae0ae6d7-7f25-48f4-addc-86d304645eb8; UBT_VID=1756522300007.1f6bFJVRyozE; ibu_online_permission_cls_ct=1; ibu_online_permission_cls_gap=1756522302376; _fwb=164nHnHV4EhHi8uQGYpleKz.1756522302378; ibu_h5_site=US; ibu_h5_group=trip; ibu_h5_local=en-us; ibu_h5_local=en-us; ibu_h5_lang=en; ibu_h5_curr=USD; _ym_uid=1756522303193972777; _ym_d=1756522303; _ym_isad=2; _gcl_au=1.1.1475222929.1756522303; _ga=GA1.1.1976303391.1756522303; _RGUID=f71105db-fedf-4543-9696-2593a6b55b5c; _scid=xToKdO-q65tUWuye-1mbtY5PxvTky7ZD; _scid_r=xToKdO-q65tUWuye-1mbtY5PxvTky7ZD; _ScCbts=%5B%5D; _sctr=1%7C1756483200000; ibusite=US; ibugroup=trip; _bfa=1.1756522300007.1f6bFJVRyozE.1.1756525552185.1756527306141.2.2.10320667452; wcs_bt=s_33fb334966e9:1756527310; _uetsid=4280b720854c11f0bbe2d13a5c34b143; _uetvid=4280d600854c11f09403a9fe052b144f; __rtbh.lid=%7B%22eventType%22%3A%22lid%22%2C%22id%22%3A%22t1o5jRHI2XRS2XhwdMg8%22%2C%22expiryDate%22%3A%222026-08-30T04%3A15%3A10.644Z%22%7D; _fbp=fb.1.1756527311325.31307931193528044; _ga_X437DZ73MR=GS2.1.s1756522302$o1$g1$t1756527311$j60$l0$h0; _combined=transactionId%3D1-mf-20250830121511774-WEB%26pageId%3D10320667452%26initPageId%3D10320667452`,
}