View Single Post
Old 09-19-2010, 10:34 PM   #2774
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 bhandarisaurabh View Post
Can you help me with the recipe of business standard the website has been updated
I want help in the print section of the recipe
if the article url is http://www.business-standard.com/ind...ky-way/406220/
and print url is
http://www.business-standard.com/ind...ono=406220&tp=
then how will we define the print section
something like this would be my first guess: if it doesn't work I'll have to test it later.
Spoiler:

Code:
def print_version(self, url):
        print 'ORG URL IS: ', url
        split1 = url.split("/")
        print 'THE SPLIT IS: ', split1 
        id = len(split1)
        # we want to find the size of the array split 
        # because we know the id will always be in the last index
        
        print_url = ‘http://www.business-standard.com/india/printpage.php?autono=’ + split1[id]+ ‘&tp=’
      return print_url

Last edited by TonytheBookworm; 09-20-2010 at 01:24 AM. Reason: typo
TonytheBookworm is offline