@@ -13,18 +13,30 @@ def test_proxy(self):
13
13
if not self .page_load_strategy == "none" and not self .undetectable :
14
14
# This page takes too long to load otherwise
15
15
self .get_new_driver (page_load_strategy = "none" )
16
+ self .open ("https://api.ipify.org/" )
17
+ ip_address = self .get_text ("body" )
16
18
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 )
19
23
print ("\n \n My IP Address = %s\n " % ip_address )
20
24
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 ]
22
34
rows = text .split ("\n " )
23
35
data = []
24
36
for row in rows :
25
37
if row .strip () != "" :
26
38
data .append (row .strip ())
27
39
print ("\n " .join (data ).replace ('\n "' , " " ))
28
40
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