View Single Post
Old 11-06-2010, 02:14 PM   #14
marbs
Zealot
marbs began at the beginning.
 
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
i havent had much luck with preprocess_html

but try coping this as is to your code:

Code:
    def preprocess_html(self, soup):
        newsbody= soup.find('div',attrs={'id':'newsbody'})
        newsblocks=nesbody.find('div',attrs=['id':'newsblocks'])
        newsbody.insert(-1, newsblocks)
        return soup
edit:
i thought of it again, you may want to try this instead:

Code:
    def preprocess_html(self, soup):
        newsblocks=soup.find('div',attrs=['id':'newsblocks'])
        soup.find('div',attrs={'id':'newsbody'}).insert(-1, newsblocks)
        return soup
tell me which one of them worked (if at all)

Last edited by marbs; 11-06-2010 at 04:08 PM.
marbs is offline   Reply With Quote