This is what you should use:
Code:
def print_version(self, url):
artl = url.rpartition('/')[0]
artl2 = artl.rpartition('/')[0]
rrest, sep, aid= artl3.rpartition('/')
cid = rrest.rpartition('/')[2]
return 'http://www.news24.com/printArticle.aspx?iframe&aid=' + aid + '&cid=' + cid