pip install jsonpath
import jsonpath
print('------------------------------------------------------------------')
import json
import requests
headers1={
"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) ""AppleWebKit/537.36 (KHTML,likeGecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0"
}
response=requests.get(url="https://careers.tencent.com/tencentcareer/api/post/Query?timestamp"
"=1728065309345&countryId=&cityId=&bgIds=&productId=&categoryId=&parentCategory"
"Id=&attrId=1&keyword=&pageIndex=1&pageSize=10&language=zhcn&area=cn",headers=headers1)
result=json.loads(response.text)
print('-------------------------------------------------------------------')
title=jsonpath.jasonpath(result,'$..RecruitPostName')#jsonpath规则有很多这里用$..
print(title)
爬虫之数据解析----jsonpath
于 2024-10-05 13:58:04 首次发布
1062

被折叠的 条评论
为什么被折叠?



