python爬取动态网页2,从JavaScript文件读取内容

import requests

import json

 

head = {"user-agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36"}

jscontent = requests.get(:http://sssssss.com,headers = head).content

jsDict = json.loads(jscontent)

jsData = jsDict['data']

comments = jsData['commentid']

for each in comments:

  pinrt each['content']

posted @ 2018-04-23 22:12  Leo包子  阅读(1502)  评论(0编辑  收藏  举报