View Single Post
Old 12-29-2011, 06:59 PM   #7
vtblogger
Junior Member
vtblogger began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2011
Device: Kindle
Hmmm.. You might want to try something like the following, in preprocess_html:

for a in soup.findAll('a'):
img = a.find('img')
if img is not None:
a.replaceWith(img)
else:
a.extract()
Haven't tried it, but I'm thinking that it should replace the relevant <a> tags with the straight embedded <img> tags, and delete all the other <a> tags. Give it a shot and let me know if it works....

Last edited by vtblogger; 12-29-2011 at 07:00 PM. Reason: typo
vtblogger is offline   Reply With Quote