Quote:
Originally Posted by TonytheBookworm
Alright I looked at some samples and I also seen what you had done. I went the second method that you mentioned though about making my own links. Well, I thought I was obviously not working. Here is what I am up with. if you have the time could you look at this and kinda shed some more light on me. Thanks.
|
Let's start at the top and look at the broad structure of what you're trying to do. I suggested you run parse_index with data pairs composed of a title for a feed and a url for a feed, then write a function that took the URL and parsed the page. I suggested you start the function with:
soup = self.index_to_soup(url)
where "url" was the url being passed to that function. In your code, you've taken the code that should have been in the called function and put it as the first line, but "url" isn't defined, so you never get a soup to work with.
To write effectively, you need to use print statements to see what's happening. Put
print 'the soup is: ', soup
after the line to see what the soup is is and you'll see url is not yet defined and tehre is no soup. If you're not going to do it the way GoComics did it, I suspect you want:
soup = self.index_to_soup("http://www.fieldandstream.com/blogs/wild-chef")
However, doing it this way will only give you one feed - the one for Wild Chef. Doing it the way GoComics does will let you set up multiple feeds.