Previous topic

libearth.parser — Parsing various RSS formats

Next topic

libearth.parser.autodiscovery — Autodiscovery

This Page

libearth.parser.atom — Atom parser

Parsing Atom feed. Atom specification is RFC 4287

libearth.parser.atom.ATOM_XMLNS_SET = frozenset(['', ''])

(frozenset) The set of XML namespaces for Atom format.

libearth.parser.atom.XML_XMLNS = ''

(str) The XML namespace for the predefined xml: prefix.

libearth.parser.atom.parse_atom(xml, feed_url, parse_entry=True)

Atom parser. It parses the Atom XML and returns the feed data as internal representation.

  • xml (str) – target atom xml to parse
  • feed_url (str) – the url used to retrieve the atom feed. it will be the base url when there are any relative urls without xml:base attribute
  • parse_entry (bool) – whether to parse inner items as well. it’s useful to ignore items when retrieve <source> in rss 2.0. True by default.

a pair of (Feed, crawler hint)

Return type:


Fork me on GitHub