google-code-export / feedparser

Automatically exported from code.google.com/p/feedparser
Other
1 stars 0 forks source link

feed.updated_parsed is None when feed had lastBuildDate #359

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
In [1]: import feedparser
In [2]: feed = feedparser.parse('http://www.raspberrypi.org/feed')
In [3]: print feed.get('updated_parsed')
>>> None

What is the expected output? What do you see instead?
Below is a snippet of the feed, it has a <lastBuildDate> so I guess 
feed.updated_parsed should be set accordingly.

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    >

<channel>
    <title>Raspberry Pi</title>
    <atom:link href="http://www.raspberrypi.org/feed" rel="self" type="application/rss+xml" />
    <link>http://www.raspberrypi.org</link>
    <description>An ARM GNU/Linux box for $25. Take a byte!</description>
    <lastBuildDate>Sun, 27 May 2012 15:55:58 +0000</lastBuildDate>
    <language>en</language>

What version of the product are you using? On what operating system?
5.1.2 with python 2.7

Please provide any additional information below.

Original issue reported on code.google.com by random35...@googlemail.com on 27 May 2012 at 9:53

GoogleCodeExporter commented 9 years ago
`feed.updated` contains the HTTP Last-Modified date and time (and 
`feed.updated_parsed` is its parsed counterpart).

You're looking for `feed.feed.updated` and `feed.feed.updated_parsed`, which is 
where the `lastBuildDate` element is stored.

Original comment by kurtmckee on 28 May 2012 at 3:49

GoogleCodeExporter commented 9 years ago
Ah, thanks.

Original comment by random35...@googlemail.com on 28 May 2012 at 10:03