Thread: web2lrf
View Single Post
Old 11-19-2007, 03:15 PM   #45
Silvayn
Member
Silvayn began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jun 2007
Location: Slovakia
Device: HTC Touch Diamond, Sony Reader 505
Hmm,

ok, i'm trying to get a printed version url, but i don't know the required string handling commands for python

i need
http://www.sme.sk/c/3592953/Ceskoslovenska-esej.html

to become
http://www.sme.sk/clanok_tlac.asp?cl=3592953


I know of 'replace'...

def print_version(self, url):
return url.replace('/c/', '/clanok_tlac.asp?cl=')

but how do i get rid of the "/Ceskoslovenska-esej.html" at the end?

Last edited by Silvayn; 11-19-2007 at 03:25 PM.
Silvayn is offline   Reply With Quote