爬虫作业

import requests

import json

a=r.get("https://edu.cnblogs.com/Homework/GetAnswers?homeworkId=2420&_=1543846454903")

b=json.loads(r.text)['data']

crawling=' '
for b in datas:
      result += str(item['StudentNo'])+','+item['RealName']+','+item['DateAdded'].replace('T',' ')+','+item['Title']+','+item['Url']+'\n'

with open('hwlist.csv','w')as f:

      f.write(result)

posted on 2018-12-05 20:30  yinjiakun  阅读(104)  评论(0)    收藏  举报

导航