View Single Post
Old 09-04-2010, 12:40 PM   #2622
TonytheBookworm
Addict
TonytheBookworm is on a distinguished road
 
TonytheBookworm's Avatar
 
Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
Quote:
Originally Posted by Starson17 View Post
I remove all tables in recipes. They tend to cause trouble.

You can use:
conversion_options = {'linearize_tables' : True}
or something like:
Code:
    def postprocess_html(self, soup, first_fetch):
        for t in soup.findAll(['table', 'tr', 'td']):
            t.name = 'div'
AWWW!!! So that is why that was in there. I seen that in one of the other recipes but wasn't sure why it was there. Let me understand and correctly if I'm wrong. In the postprocess it is finding all instances of the table tr and td and then changing their name to div or making them div tags if you will.. One last thing while on the subject. I wasn't too clear on the postprocess_html parameters. It takes 3 arguments. The first 2 I understand but I'm confused about the first_fetch cause in some recipes I noticed they use first. So are these reserved words and if so what do they do exactly? Thanks again. Learning so much from you!!!
TonytheBookworm is offline