Created
October 21, 2015 15:12
-
-
Save dragonly/18a6e392170de55a91e6 to your computer and use it in GitHub Desktop.
py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import xml.etree.ElementTree as ET | |
import xmltodict | |
import pprint | |
import json | |
url_base = 'http://bbs.fudan.edu.cn/bbs/rss?bid=%s' | |
board_range = range(1,299) | |
channels = [] | |
for board in board_range[:1]: | |
channel = {} | |
url = url_base % board | |
xml = requests.get(url).content | |
data = xmltodict.parse(xml) | |
channel = data['rss']['channel'] | |
items = channel['item'] | |
pprint.pprint(json.dumps(items)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment