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
agentwill identify the software making the request,etagwill identify the last HTTP ETag header returned by the webserver, andmodifiedwill identify the last HTTP Last-Modified header returned by the webserver.agentandetagmust be strings, whilemodifiedcan be either a string or a Pythondatetimeobject.If
agentis not provided, theUSER_AGENTglobal variable will be used by default.