@@ -13,18 +13,30 @@ def test_proxy(self):
1313 if not self .page_load_strategy == "none" and not self .undetectable :
1414 # This page takes too long to load otherwise
1515 self .get_new_driver (page_load_strategy = "none" )
16+ self .open ("https://api.ipify.org/" )
17+ ip_address = self .get_text ("body" )
1618 self .open ("https://ipinfo.io/" )
17- self .wait_for_non_empty_text ("form input" , timeout = 20 )
18- ip_address = self .get_text ('#ip-string span[class*="primary"] span' )
19+ self .type ('input[name="search"]' , ip_address , timeout = 20 )
20+ self .click ("form button span" )
21+ self .sleep (2 )
22+ self .click_if_visible ("span.cursor-pointer" , timeout = 4 )
1923 print ("\n \n My IP Address = %s\n " % ip_address )
2024 print ("Displaying Host Info:" )
21- text = self .get_text ("#widget-scrollable-container" ).split ("asn:" )[0 ]
25+ text = self .get_text ("#block-summary" ).split ("Hosted domains" )[0 ]
26+ rows = text .split ("\n " )
27+ data = []
28+ for row in rows :
29+ if row .strip () != "" :
30+ data .append (row .strip ())
31+ print ("\n " .join (data ).replace ('\n "' , " " ))
32+ print ("\n Displaying Geolocation Info:" )
33+ text = self .get_text ("#block-geolocation" ).split ("Coordinates" )[0 ]
2234 rows = text .split ("\n " )
2335 data = []
2436 for row in rows :
2537 if row .strip () != "" :
2638 data .append (row .strip ())
2739 print ("\n " .join (data ).replace ('\n "' , " " ))
2840 if not self .headless :
29- print ("\n The browser will close automatically in 7 seconds..." )
30- self .sleep (7 )
41+ print ("\n The browser will close automatically in 3 seconds..." )
42+ self .sleep (3 )
0 commit comments