How to parse the “” using feedparser?

后端 未结 2 754
眼角桃花
眼角桃花 2021-02-06 13:16

The rss file is shown as below, i want to get the content in section media:group . I check the document of feedparser, but it seems not mention this. How to do

2条回答
  •  说谎
    说谎 (楼主)
    2021-02-06 14:01

    You can parse the feed using

    feed = feedparser.parse(your_feeds_url)
    

    and then access your xml elements using either python's attribute access or dictionary-like access on feed and its subelements. The former method won't work for an element name like media:content, so use the latter method.

    The rest should become clear after studying the examples at http://www.feedparser.org

提交回复
热议问题