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: 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable tad na writes: > python 2.7.2 > > The following code has an error and I can not figure out why: > > import feedparser > d =3D feedparser.parse('http://bl.ocks.org/mbostock.rss') > numb =3D 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(pubDa= te)????? > 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 =2D-=20 regards, kushal --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTW+M9AAoJEKolkdITDqLtVYMH/R4xdWV/lvUcLgZXCcWFvZmd z/vzDB1aMtnEkCQOdUYWYGVNq6io0RBY3DzvXAkeuxoEFa6lLDRbOf24K/wNTPIj VqgUTFu7A7F1TV9xowQcPUFp9eP+lt2Zju7OjDO8GjPuqLOh2zpyXyIuLnBWmBOW 9OwAtcfMH7tJkjtVt3TnXG9AU6JgGpOTKRHYgmm+FFXvwYtBXEoLp9iTRJ8HV4Yj ImLCuFQpRUz1Om932QcvLIMwdFsAu3KMRxjR4jYeLbBLmrBirPkLn6iQ/hatgruX kmFczjkVE/9YQ/XV5FmmSa7lPT3CekZkkTQ+nOO1K0t4bTD1mZ59111xwPCw2p4= =m78K -----END PGP SIGNATURE----- --=-=-=--