tag中提取json提取不出来求解 #python#beautifulsoup

tag中提取json提取不出来求解 #python#beautifulsoup

问题描述:

图片说明图片说明

如图所示,想从阿里法排中爬取名称和价格,试过几个方法,但是json爬不出来,求老师们解答

试下下面查找json内容:

bs.find(type="text/json").string

你直接去找对应的json文件就行,然后去json解析就好了啊,就像我这样写,

import requests,json
url='http://wensong.xyz:9999/?url=https://v.douyin.com/J2G82fF/'
html=json.loads(requests.get(url).text)['title']
print(html)