以DHL为例:https://mydhlplus.dhl.com/cn/zh/tracking.html#/results?id=单号
...
方式一:
第一步请求abck(已过akamai)
通过接口带abck的cookie1.75(接口) 获取带abck的cookie信息,该abck已过akamai可以直接使用
请求数据如下:
Code Block |
---|
{
"appid": "填入appid",
"jsUrl": "https://mydhlplus.dhl.com/hWSpQHIBF/AaJp4XYo/E_lfGeho/I0/J3iNNSXrYm5h/Pyd0AQ/HXM_VEQh/XnA"
} |
返回数据如下:
Code Block |
---|
{
"code": "0",
"data": "_abck=940FD3ABFBEBA687C229E0E26C9AE096~0~YAAQB8rdPD0AZmGCAQAA8JXNnwgeWAODR8G3bOb6G6Xi4Sw9EauR42jeZ0sa3L2sXGvrars16esq2JN1WQklve6zLTO5v7TR8IAyFD7Tl3b5TQcCfrAabOfdr20EfPtV1ML+26PHJAbNXJonZGULVvExVd383zzQSwqFuoCzcyWUALyw8bfR4oP8VUsJkFDPMqIrRJy/cgkaAmPCF0RCxVTuUX4nOOUe1MzzpGhp2l6BygtJLjZ2zxG3Lwjkw/La5G8svI1K/OiFaqWA20I5GQjmLIMBdpPpBAv5DuGCvgP2pIMfoDURaLwKEwMO8YaL2/8Mt3cqFFpXMFgmSnN6+Qi0JApmJ/TbuVFe631zi6j1NqONbgHDr7ju2eMOBMfg/Lw6NKYpCl+fHUAe+19oBCgj1zAn~-1~||1-EMXgNKYqPS-1-10-1000-2||~-1; bm_sz=295AD9EF232C9EC36A3D8E21CF47E7E2~YAAQB8rdPBgAZmGCAQAAh5DNnxCqa2QwV5f43VGDJ6W1GfRSOX12paCV3fa9SgVbyZWxbQHxzOmJoTNKXsnmWBZQgHoZ5czPQi6NP79DVlwg0G7gcHV+DE/b8YhCZ5W1ZSX3yKKQ3JN+vrDiwCitICFID6R2lZbC9X8pgmuhdNvDY7NRjNSexjg/keyF7wrgoK4LYnNnFM7Mxw+Nq4tK0tsPt3Z6wwiVMsL8c98QfQK2WbQYca7jt1aRZ2ztaO5hgdJ5+1t8hTL/37sVjALF9U51rXOImh98jeNADUrh0YM=~4276545~4534585",
"fail": false,
"msg": "成功",
"succ": true
} |
第二步业务请求
根据第一步返回的带abck的cookies信息构造
后面可以通过程序正常访问其业务:
如使用http测试如下:
Code Block |
---|
GET https://mydhlplus.dhl.com/shipmentTracking?AWB=6195806046&countryCode=cn&languageCode=zh
accept: application/json, text/plain, */*
accept-encoding: gzip, deflate, br
accept-language: zh-CN,zh;q=0.9
cookie: _abck=C8643DBD680B3A9B06B6A3FB4FC96B5D~-1~YAAQbp7C3fKba2SCAQAAdxc4nwjlIf0SAG4mrOSYUtFjQjPX1iCxEHuXLyCDTl2Z1mJmXN98Xyk8qP00MI9JD4bMxN5RbC82AwpieBgmxKhn7S+WLNV2HE48iaLLHGBDJTAP7QuwbwbEKaqk8YWI08+9DTscV2/2XAcDMugfy83fX7O7tlktdje7OHbbn+CETt7c2xlPip0Kijw3Kzp3CjParRqg7n2CEVnfhQ8ns3GYHAI5oGfbmeqrUIr91S1gsfwlPzcJtoUlro9qV5hjVTFgWGJYSp7XT7+/qggPVRgdRSfRH1byyVuvjUV1MakUihptg4CTtAHDyOUNI4QmdsTKE/T8LOuhBK/KZBr+RhDG2YKR24M=~-1~-1~-1; bm_sz=089CAFB49971B46B55B0C713526B0F59~YAAQbp7C3fOba2SCAQAAdxc4nxCGgnBcuIXw405DyBjDvDN7mmBRn6GukuphJj/M6xkfkUOgjeM6DyxZWmAnv9XAjKS++MmwOLTqP9lPpztSW9gjmOXyVLwBuEyevTF84NAWmU2gbH1tBzX0PPvfi/akg9p2Ci+/0uJCqAu1MvyL/LoNW3OxvOyHKQC8TOXphoERzQoAp7zwDPfg6J3m+Uxq73CmQxAXjc6As8Z2tsAEgF0ABaP8tNqNQRhvUkkGeR5rhSxLsemo4Ow/ZWxBSN2gTc8+ljgMod6kQM8TmyM=~3687224~4536631
referer: https://mydhlplus.dhl.com/cn/zh/tracking.html
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36 |
响应
Code Block |
---|
{
"results": [
{
"id": "6195806046",
"label": "运单",
"type": "airwaybill",
"duplicate": false,
"delivery": {
"code": "101",
"status": "delivered"
},
.... |
方式二:(当方式一不能满足需求时):
第一步过ja3获取abck
通过接口TLS代理(接口) 获取_abck和bm_sz
...
Info |
---|
注意:此处为什么请求https://mydhlplus.dhl.com/hWSpQHIBF/AaJp4XYo/E_lfGeho/I0/J3iNNSXrYm5h/Pyd0AQ/HXM_VEQh/XnA来获取abck? 因为该地址的响应速度最快且可以返回abck(该地址长期有效无需更换) |
第二步过sensor_data行为数据(包括ja3)
通过第一步获取cookie中的_abck和bm_sz,在后面的请求中需要加到请求cookie中。
...
Code Block |
---|
{ "code": "0", "cookies": [ "_abck=C8643DBD680B3A9B06B6A3FB4FC96B5D~-1~YAAQbp7C3ZhEbGSCAQAA7y1FnwgtA3vni4mLtciaO9XbKGrbOip5IR76aFPOtWQW0lWO2ssk1hpj8O9bDV+Mt/vBtT1OuZUGQWKkUzWsQOF2k6uQTSvNdn3Jpiey5gXucLgQGoSUlD6UPSbkgjnjydO2IIPSxSaSaM1BIYyfiqz6OTRPYDDLXZpPpYurdQ2NWBvX8BSr5br30Wa/4h5bznU4rBNasOPVI1P0RfnGUG01Qh3JQphBkcZV3BmuSywI28IIPVQ5nQr9MPn980w4HOTutLiqfLt3D1uCnH1gctCYG9ONwJV9/BcDzd+bprKFube+yNM1gRpiJEe9xvvLemVhZQjE8eSDYoib0m0k59423ojoEcrtBwTaAT6w2GwAKDVwJg==~-1~-1~-1; Domain=.dhl.com; Path=/; Expires=Tue, 15 Aug 2023 02:11:27 GMT; Max-Age=31536000; Secure", "bm_sz=089CAFB49971B46B55B0C713526B0F59~YAAQbp7C3ZlEbGSCAQAA7y1FnxDyCYX/ezIAdNZVd0BozGVv4bNSznG95gNQOojEeM2T0e2yjagCAPIi/sVo5RiEDrHTea6vv7aCTvGKJtnjf0dGQzT/+WrKrDAggBipuG01YtPUzMQRdd1IL+mWDvYdDe8/aNTFt9JVf2bGZscE+UzbBRBY8thWkqC00GYHq4QRyoSOPdFWQJKnPyefsATJ4iW6n/z8v3LAvthjBtrpIyTKtsIQ3vpbA/G/hN1aKKWAcfOaLDAo/vrlcEGzwthuaz0fx4cY7wF9+f55MY7v~3687224~4536631; Domain=.dhl.com; Path=/; Expires=Mon, 15 Aug 2022 02:56:27 GMT; Max-Age=2700" ], "fail": false, "msg": "成功", "name": "", "result": "{\"success\":true}", "succ": true } |
第三步业务请求
后面可以通过程序正常访问其业务:
如使用http测试如下:
...
Code Block |
---|
{ "results": [ { "id": "6195806046", "label": "运单", "type": "airwaybill", "duplicate": false, "delivery": { "code": "101", "status": "delivered" }, .... |