View Single Post
Old 08-26-2010, 09:34 PM   #2535
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
Starson I know ask before but I'm still not clear on how to do it
if i have for instance the following link (example only)
http://www.testpage.com/doi/abs/10.1...495?ai=rv&af=R
but I need it to be the following
http://www.testpage.com/doi/full/10....viewType=Print

how would I do this?
I figure it would be some form or search and replace like i seen in beautiful soup but again i'm kinda clueless (any examples of this in action ? )

the abs needs to be replaced with full and then simply append the ?view part yet not sure how this is done thanks again. I hope to learn something new.

Maybe something like ?
Spoiler:
Code:
def preprocess_html(soup)
     for abs in soup.findall('abs)
     newtext ='full'
     abs.replaceWith(newtext)

the above is just a non-working guess

Last edited by TonytheBookworm; 08-26-2010 at 09:48 PM.
TonytheBookworm is offline