#NEWLINE# def randomagent( ) : #NEWLINE# #INDENT# BR_VERS = [ [ ( '%s.0' % i ) for i in xrange ( 18 , 43 ) ] , [ '37.0.2062.103' , '37.0.2062.120' , '37.0.2062.124' , '38.0.2125.101' , '38.0.2125.104' , '38.0.2125.111' , '39.0.2171.71' , '39.0.2171.95' , '39.0.2171.99' , '40.0.2214.93' , '40.0.2214.111' , '40.0.2214.115' , '42.0.2311.90' , '42.0.2311.135' , '42.0.2311.152' , '43.0.2357.81' , '43.0.2357.124' , '44.0.2403.155' , '44.0.2403.157' , '45.0.2454.101' , '45.0.2454.85' , '46.0.2490.71' , '46.0.2490.80' , '46.0.2490.86' , '47.0.2526.73' , '47.0.2526.80' ] , [ '11.0' ] ] #NEWLINE# WIN_VERS = [ 'Windows NT 10.0' , 'Windows NT 7.0' , 'Windows NT 6.3' , 'Windows NT 6.2' , 'Windows NT 6.1' , 'Windows NT 6.0' , 'Windows NT 5.1' , 'Windows NT 5.0' ] #NEWLINE# FEATURES = [ '; WOW64' , '; Win64; IA64' , '; Win64; x64' , '' ] #NEWLINE# RAND_UAS = [ 'Mozilla/5.0 ({win_ver}{feature}; rv:{br_ver}) Gecko/20100101 Firefox/{br_ver}' , 'Mozilla/5.0 ({win_ver}{feature}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{br_ver} Safari/537.36' , 'Mozilla/5.0 ({win_ver}{feature}; Trident/7.0; rv:{br_ver}) like Gecko' ] #NEWLINE# index = random . randrange ( len ( RAND_UAS ) ) #NEWLINE# return RAND_UAS [ index ] . format ( win_ver = random . choice ( WIN_VERS ) , feature = random . choice ( FEATURES ) , br_ver = random . choice ( BR_VERS [ FEATURES ] ) )