parse()¶
- listparser.parse(obj[, agent, etag, modified])¶
Parse a subscription list and return a dictionary containing the results.
- Parameters:
obj (file or string) – a file-like object or a string containing a URL, an absolute or relative filename, or an XML document
agent (string) – User-Agent header to be sent when requesting a URL
etag (string) – ETag header to be sent when requesting a URL
modified (string or datetime) – Last-Modified header to be sent when requesting a URL
- Returns:
all of the parsed information, webserver HTTP response headers, and any exception encountered
- Return type:
dictionary
parse()
is the only public function exposed by listparser.If obj is a URL, the
agent
will identify the software making the request,etag
will identify the last HTTP ETag header returned by the webserver, andmodified
will identify the last HTTP Last-Modified header returned by the webserver.agent
andetag
must be strings, whilemodified
can be either a string or a Pythondatetime
object.If
agent
is not provided, theUSER_AGENT
global variable will be used by default.