import urllib2,urllib
import re

 
def spiders():
    image_number = 0
    
    for page_number in range(1,9):
        
        site_url = "http://500px.com/search?exclude_nude=true&page="+str(page_number)+"&q=pikachu&type=photos"
        print site_url
        html = urllib2.urlopen(site_url).read()
        
        image_reg_string = r'src="(.*?\.jpg)" '   
        img_reg = re.compile(image_reg_string)
        
        image_list = re.findall(img_reg,html) # find all images that match RE 
                
        for image_url in image_list:
            urllib.urlretrieve(image_url,'picture_%s.jpg' %image_number) # download the teledata
            print "Download %s images" %image_number
            image_number += 1
            
    print "END"
    
    
if __name__ == "__main__":
    spiders()


@@ -7,17 +7,24 @@
  urllib2
-,
+%0Aimport 
 urllib%0Ai
@@ -33,18 +33,16 @@
 ort re%0A%0A
- %0A
 def spid
@@ -729,28 +729,16 @@
 er += 1%0A
-            
 %0A    pri
@@ -751,21 +751,16 @@
 D%22%0A    %0A
-    %0A
 if __nam
@@ -792,9 +792,8 @@
 iders()%0A
-%0A

Format spiders_pikachu.py