On Sat, Mar 22, 2014 at 5:21 AM,  <teddyb...@gmail.com> wrote:
> I am trying to get all the element data from the rss below.
> The only thing I am pulling is the first element.
> I don't understand why the for loop does not go through the entire rss.
> Here is my code....

[SNIP]

> for item in soup.find_all('item'):
> #for item in soup:
>     title = soup.find('title').text
>     link = soup.find('link').text
>     item = soup.find('item').text

The three find method calls in the for loop are searching from the
document root (the "soup" variable), not from the item you're
currently iterating at.  Try changing these to calls of item.find. And
note that calling one of the results "item" will replace the loop
variable.  That won't affect the iteration, but it's bad practice to
refer to two different things by the same local name.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to