import requests,json
from lxpy import copy_headers_dict
# cookie写自己的就行
for page in range(1,1000):
url = "https://www.sf-express.com/sf-service-core-web/service/waybills/list/send?lang=sc®ion=cn&translate=sc×tamp=1669796557279&pageNo="+ str(page) +"&pageRows=10"
headers = '''
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
Connection: keep-alive
Cookie:
Host: www.sf-express.com
Referer: https://www.sf-express.com/we/ow/chn/sc/waybill/list
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.56
'''
headers = copy_headers_dict(headers)
res = requests.get(url=url,headers=headers)
# print(res.text)
res = json.loads(res.text)
if len(res['result']['content']) == 0:
print("ending...")
break
for i in range(len(res['result']['content'])):
orderno = res['result']['content'][i]['waybillno']
city = res['result']['content'][i]['destinationCityName']
endTime = res['result']['content'][i]['endTime']
print(orderno,city,endTime)
顺丰快递单号批量提取
最新推荐文章于 2023-02-27 18:20:41 发布