Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!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.049 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'attribute': 0.07; 'subject:help': 0.08; 'suggest': 0.14; '23,': 0.16; 'soup': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'email addr:gmail.com>': 0.22; 'print': 0.22; 'error': 0.23; 'instead.': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'skip:d 20': 0.34; 'problem': 0.35; 'subject:with': 0.35; 'received:google.com': 0.35; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'tag': 0.61; 'first': 0.61; 'mar': 0.68; 'beautiful': 0.68; 'results': 0.69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=TmLhCTcjOF8TLxn+IP8cL9I9N/sWvHXK/zAIYQJKuSs=; b=M1lfEZGOX0vXtG6+4M4qwVOw8Op9KRW4CDAunlH/b2LGSRAEoQnPjR3u2gIccyjpCN XW1TLMYvK/d27aifl2Vm6jIQ43fBTDdQbrbRp6cA44boDNxVFcRrh/h1emykfiJ5hQzL LxghItGvrlIdn/tCyK0rC1UGq/cADvZ4nLLUYNwokXNl1M3JW/h8k9YEsmMO2eLNfbcg zaR3mOKaPs2vkOWGeRAkgXpYlkzBv+Aa2sbl+uG2ZK/TTkcZypvBI+LfMpidQh+qwOIY O/z7I4FHbRa5XpKCn0/o5++uLl07K7HY9i3wFwv1fG0GpqL1K79LwW2K6RkJ5j+qcAGN 8h3Q== MIME-Version: 1.0 X-Received: by 10.68.135.195 with SMTP id pu3mr68609020pbb.70.1395614681769; Sun, 23 Mar 2014 15:44:41 -0700 (PDT) In-Reply-To: <5f8a6cae-4e84-4748-beb1-fd931b187e4e@googlegroups.com> References: <84eb4c69-d43d-4777-8a99-34eed9be73d6@googlegroups.com> <03c8b5d0-363e-4287-80d0-a43b0266f2a3@googlegroups.com> <5f8a6cae-4e84-4748-beb1-fd931b187e4e@googlegroups.com> Date: Sun, 23 Mar 2014 16:44:41 -0600 Subject: Re: help with for loop----python 2.7.2 From: Ian Kelly To: Python Content-Type: multipart/alternative; boundary=e89a8ffbad2759acd004f54ddd93 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395614684 news.xs4all.nl 2856 [2001:888:2000:d::a6]:51900 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68823 --e89a8ffbad2759acd004f54ddd93 Content-Type: text/plain; charset=ISO-8859-1 On Mar 23, 2014 3:56 PM, "tad na" wrote: > > This is the error I get with > 1. print data[x].pubDate.text > AttributeError: 'NoneType' object has no attribute 'text' > 2. print data[x].pubDate > It results in "None" So the problem is that it's not even finding the pubDate tag in the first place. Some sites on the Web suggest that beautiful soup normalizes all tags to lowercase; try looking for the pubdate tag instead. --e89a8ffbad2759acd004f54ddd93 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Mar 23, 2014 3:56 PM, "tad na" <teddybubu@gmail.com> wrote:
>
> This is the error I get with
> 1. print data[x].pubDate.text
> =A0 =A0 AttributeError: 'NoneType' object has no attribute = 9;text'
> 2. print data[x].pubDate
> =A0 =A0 It results in "None"

So the problem is that it's not even finding the pubDate= tag in the first place. Some sites on the Web suggest that beautiful soup = normalizes all tags to lowercase; try looking for the pubdate tag instead.<= br>

--e89a8ffbad2759acd004f54ddd93--