Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70635

Re: feedparser error

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <kushal.kumaran@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:error': 0.03; 'attribute': 0.07; 'received:198': 0.07; 'here?': 0.09; 'url:rss': 0.09; 'python': 0.11; '"object': 0.16; '2.7.2': 0.16; '416,': 0.16; 'feedparser': 0.16; 'why:': 0.16; 'import': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'skip:" 30': 0.26; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'raise': 0.29; 'code': 0.31; 'writes:': 0.31; 'file': 0.32; 'figure': 0.32; 'skip:- 30': 0.32; 'skip:u 20': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'here:': 0.62; 'message-id:@mx.google.com': 0.80; "else's": 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=eGGilAA8TkDtjuQV05K3d3HszKJukJZqmVuacJO8g+g=; b=FzYZ4HEDwma9RAby5glo3hNcYRABXAZNv48QxluRKWm513a9p1J9iOdg7a+1SSJi2G FqLtL4vJFZ0ERL2CC7VwkcQSBwUJXBGfOyLv7rn1SOncW+qx6oa2iRxQtOpijpOaCbxZ ombF2TouDfZWQsciYSlZwE5XV1WAtjo5rjbFUYSxsRV2pqZQ2c+7WYdnAjQsM2dm/Veb fVOcxNMk5ISEEphKD1m1AOq+P06AA7bpgtAcr/mvL5SQczjD8khW0nAAaTsO/elPkUa1 btXrEY4ZG+sWxHHR4wxH8RQaNaJ1Oxz08piMoffUcx+3y/ne7JDBJhIPrvd3WZMi18YC 5TDA==
X-Received by 10.140.94.39 with SMTP id f36mr19934939qge.64.1398530889289; Sat, 26 Apr 2014 09:48:09 -0700 (PDT)
X-Google-Original-Message-ID <874n1gvxz6.fsf@carbon.locationd.net.>
From Kushal Kumaran <kushal.kumaran@gmail.com>
To python-list@python.org
Subject Re: feedparser error
In-Reply-To <4f7cfadc-6b9b-488a-b2cd-b90dd53acbfc@googlegroups.com>
References <4f7cfadc-6b9b-488a-b2cd-b90dd53acbfc@googlegroups.com>
User-Agent Notmuch/0.17+135~g3fed673 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu)
Date Sat, 26 Apr 2014 22:17:57 +0530
MIME-Version 1.0
Content-Type multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature"
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9521.1398530898.18130.python-list@python.org> (permalink)
Lines 53
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1398530898 news.xs4all.nl 2886 [2001:888:2000:d::a6]:35214
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:70635

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

tad na <teddybubu@gmail.com> writes:

> python 2.7.2
>
> The following code has an error and I can not figure out why:
>
> import feedparser
> d = feedparser.parse('http://bl.ocks.org/mbostock.rss')
> numb = len(d['entries'])
> for post in d.entries:
>     print post.pubDate+"\n"
>
> -----------------------------------
> the error is :
>
>     print post.pubDate+"\n"
>   File "build\bdist.win32\egg\feedparser.py", line 416, in __getattr__
>     raise AttributeError, "object has no attribute '%s'" % key
> AttributeError: object has no attribute 'pubDate'
>
> -----------------------------------
>
> The only thing I can think of is feedparser does not like uppercase(pubDate)?????
> I can not change someone else's rss.   What can I do here?

You want post.published, or post.published_parsed.  See the feedparser
documentation here:
https://pythonhosted.org/feedparser/reference-entry-published.html

-- 
regards,
kushal

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

feedparser error tad na <teddybubu@gmail.com> - 2014-04-25 19:16 -0700
  Re: feedparser error Kushal Kumaran <kushal.kumaran@gmail.com> - 2014-04-26 22:17 +0530
  Re: feedparser error MRAB <python@mrabarnett.plus.com> - 2014-04-26 17:55 +0100
    Re: feedparser error tad na <teddybubu@gmail.com> - 2014-04-26 12:22 -0700

csiph-web