Use the index_to_soup() method instead of urllib2. WHat you want to do in preprocess_html is
run index_to_soup, find the img element you want in the soup returned by index_to_soup and insert it into the soup passed into preprocess_html. See the BeautifulSoup docs for how to do that.
|