Thanks for this post.
This is how I achived the same. You can see I used the same trick to make article title better standing out.
Spoiler:
PHP Code:
def preprocess_html(self, soup):
# Finds all the jpg links
for figure in soup.findAll('a', attrs = {'href' : lambda x: x and 'jpg' in x}):
# makes sure that the link points to the absolute web address
if figure['href'].startswith('/'):
figure['href'] = self.site + figure['href']
figure.name = 'img' # converts the links to img
figure['src']= figure['href'] # with the same address as href
# Makes the title standing out
title = soup.find('a', attrs = {'class': 'commonSectionTitle'})
title.name = 'h1'
return soup