#NEWLINE# def get_html( self , config , url ) : #NEWLINE# #INDENT# '\n        ' #NEWLINE# if isinstance ( url , unicode ) : #NEWLINE# #INDENT# url = url . encode ( 'utf-8' ) #NEWLINE# #UNINDENT# cookiejar = cookielib . LWPCookieJar ( ) #NEWLINE# opener = urllib2 . build_opener ( urllib2 . HTTPCookieProcessor ( cookiejar ) ) #NEWLINE# urllib2 . install_opener ( url ) #NEWLINE# headers = { #NEWLINE# #INDENT# 'User-agent' : config . browser_user_agent , #NEWLINE# #UNINDENT# } #NEWLINE# request = urllib2 . Request ( url , headers = headers ) #NEWLINE# try : #NEWLINE# #INDENT# result = urllib2 . urlopen ( request ) . read ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# return result