Quote:
Originally Posted by marbs
if you do not want the link at all you could use remove_attrs to remove the href attribute
|
This is what I recommend for link cleanup:
Code:
def preprocess_html(self, soup):
for alink in soup.findAll('a'):
if alink.string is not None:
tstr = alink.string
alink.replaceWith(tstr)
return soup
This converts all links to text (less tags means safer rendering)