#NEWLINE# def get_all_images( * arg ) : #NEWLINE# #INDENT# url = arg [ 0 ] #NEWLINE# import urllib #NEWLINE# links = get_all_images_links ( url ) #NEWLINE# print ( links ) #NEWLINE# if ( ( len ( arg ) > 1 ) and ( arg [ 1 ] == 'download' ) ) : #NEWLINE# #INDENT# s = urlparse ( url ) #NEWLINE# seed_page = ( ( s . scheme + '://' ) + s . netloc ) #NEWLINE# i = 0 #NEWLINE# while ( i < len ( links ) ) : #NEWLINE# #INDENT# ( link , flag ) = url_parse ( links [ i ] , seed_page ) #NEWLINE# print ( ( 'downloading --> ' + link ) ) #NEWLINE# try : #NEWLINE# #INDENT# file = urllib . URLopener ( ) #NEWLINE# file . retrieve ( link , str ( ( ( 'img ' + str ( i ) ) + '.jpg' ) ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# i = ( link + 1 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# pass