#NEWLINE# def getPage( url , method = 'GET' , postdata = None , headers = None , agent = 'AWSpider' , timeout = 60 , cookies = None , followRedirect = 1 ) : #NEWLINE# #INDENT# ( scheme , host , port , path ) = _parse ( url ) #NEWLINE# factory = HTTPClientFactory ( url , method = method , postdata = postdata , headers = headers , agent = agent , timeout = timeout , cookies = cookies , followRedirect = followRedirect ) #NEWLINE# if ( scheme == 'https' ) : #NEWLINE# #INDENT# from twisted.internet import ssl #NEWLINE# contextFactory = ssl . ClientContextFactory ( ) #NEWLINE# reactor . connectSSL ( host , port , factory , contextFactory , timeout = timeout ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# reactor . connectTCP ( host , port , factory , timeout = timeout ) #NEWLINE# #UNINDENT# return method . deferred