网页爬虫 - python 爬虫怎么处理json内容
本文介绍了网页爬虫 - python 爬虫怎么处理json内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
看不清的话 网站地址是http://www.sse.com.cn/disclos...
红字是我需要的内容 但是我提取不出来
求教怎么操作
解决方案
import requests
url = 'http://query.sse.com.cn/commonSoaQuery.do?siteId=28&sqlId=BS_GGLL&extGGLX=&stockcode=&channelId=10743%2C10744%2C10012&extGGDL=&order=createTime%7Cdesc%2Cstockcode%7Casc&isPagination=true&pageHelp.pageSize=15&pageHelp.pageNo=1&pageHelp.beginPage=1&pageHelp.cacheSize=1&pageHelp.endPage=5'
headers = {
'Referer':'http://www.sse.com.cn/disclosure/credibility/supervision/inquiries/',
'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
}
r = requests.get(url, headers=headers)
print r.json()['result']
这篇关于网页爬虫 - python 爬虫怎么处理json内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文