#NEWLINE# def largest_image_url( self ) : #NEWLINE# #INDENT# if ( ( not self . imgs ) and ( not self . top_img ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if self . top_img : #NEWLINE# #INDENT# return self . top_img #NEWLINE# #UNINDENT# max_area = 0 #NEWLINE# max_url = None #NEWLINE# for img_url in self . imgs : #NEWLINE# #INDENT# dimension = fetch_image_dimension ( img_url , self . useragent , referer = self . url ) #NEWLINE# area = self . calculate_area ( img_url , dimension ) #NEWLINE# if ( area > max_area ) : #NEWLINE# #INDENT# max_area = area #NEWLINE# max_url = img_url #NEWLINE# #UNINDENT# #UNINDENT# log . debug ( 'using max img {}' . format ( max_url ) ) #NEWLINE# return max_url