title: How to scrape the images from the website?
body: <p>How can we get all the images of this site: <a href="http://www.theft-alerts.com" rel="nofollow">http://www.theft-alerts.com</a>
  We need the images of the 19 pages. Sow far we have this code, but it doesn't work yet. We want the images in a new map. </p>
  
  <pre><code>#!/usr/bin/python
  
  import [urllib2][1]
  from bs4 import BeautifulSoup
  from urlparse  import urljoin
  
  url = "http://www.theft-alerts.com/index-%d.html"
  page = urllib2.urlopen(url).read()
  soup = BeautifulSoup(page, "html.parser")
  
  base = "http://www.theft-alerts.com"
  
  images = [urljoin(base,a["href"]) for a in soup.select("td a[href^=images/]")]
  
  for url in images:
      img = BeautifulSoup(urllib2.urlopen(url).read(),"lxml").find("img")["src"]
  with open("myimages/{}".format(img), "w") as f:
      f.write(urllib2.urlopen("{}/{}".format(url.rsplit("/", 1)[0], img)).read())
  </code></pre>