That is an Atom feed; use feedparser to parse that file into individual articles.
import feedparser
d = feedparser.parse('/path/to/your/xmlfile.xml')
for entry in d.entries:
print entry.title
This prints:
模板: R
为此博客设置的发布类型。
此博客管理员的电子邮件列表。
此博客是否包含成人内容
是否允许使用备用的 JS 渲染
博客的 Google Analytics(分析)帐号
存档索引日期格式的编号
此博客的存档频率应该为多少
有权进行发布的作者的电子邮件列表。
是否在博客中显示评论反向链接
是否为每个帖子提供存档页
哪些人能发表评论
是否要求评论者完成 Captcha
用于接收新评论通知的电子邮件地址列表
为博客评论所提供的 Feed 类型
博客评论表位置
博客评论消息
是否启用评论审阅
新评论进行审阅的天数
用于接收需要审阅新评论的通知的电子邮件地址
etc.
You can see what items each entry defines by looking at the result of the .keys()
method:
>>> d.entries[0].keys()
['updated', u'gd_image', 'updated_parsed', 'published_parsed', 'tags', 'title', 'links', 'summary', 'content', 'guidislink', 'title_detail', 'link', 'author', 'published', 'authors', 'author_detail', 'id']
If you want to convert your HTML content to text, there are a few options. Most are listed in:
Extracting text from HTML file using Python