View Single Post
Old 03-12-2022, 09:43 AM   #6
jma1
Connoisseur
jma1 began at the beginning.
 
Posts: 85
Karma: 10
Join Date: Dec 2015
Device: Kindle
Perfect - thanks.

As an aside, I often use the following to remove hyperlinks. Is there an easy way to format the affected text from which hyperlink was removed (perhaps with underlining) to leave a visible trace indicating that there is a link in the source document?

def postprocess_html(self, soup, first_fetch):
for a in soup.findAll('a', href=True):
del a['href']
return soup
jma1 is offline   Reply With Quote