@@ -900,6 +900,11 @@ def _uc_gui_click_captcha(
900
900
and driver .is_element_present ("%s div" % frame )
901
901
):
902
902
frame = "%s div" % frame
903
+ elif (
904
+ driver .is_element_present ('[name*="cf-turnstile-"]' )
905
+ and driver .is_element_present ('[class*=spacer] + div div' )
906
+ ):
907
+ frame = '[class*=spacer] + div div'
903
908
elif (
904
909
driver .is_element_present ('[name*="cf-turnstile-"]' )
905
910
and driver .is_element_present ("div.spacer div" )
@@ -975,13 +980,16 @@ def _uc_gui_click_captcha(
975
980
driver .switch_to .default_content ()
976
981
except Exception :
977
982
return
978
- driver .disconnect ()
979
- try :
980
- if x and y :
981
- sb_config ._saved_cf_x_y = (x , y )
982
- _uc_gui_click_x_y (driver , x , y , timeframe = 0.95 )
983
- except Exception :
984
- pass
983
+ if x and y :
984
+ sb_config ._saved_cf_x_y = (x , y )
985
+ if driver .is_element_present (".footer .clearfix .ray-id" ):
986
+ driver .uc_open_with_disconnect (driver .current_url , 3.8 )
987
+ else :
988
+ driver .disconnect ()
989
+ try :
990
+ _uc_gui_click_x_y (driver , x , y , timeframe = 0.54321 )
991
+ except Exception :
992
+ pass
985
993
reconnect_time = (float (constants .UC .RECONNECT_TIME ) / 2.0 ) + 0.6
986
994
if IS_LINUX :
987
995
reconnect_time = constants .UC .RECONNECT_TIME + 0.2
@@ -991,7 +999,7 @@ def _uc_gui_click_captcha(
991
999
caught = False
992
1000
if (
993
1001
driver .is_element_present (".footer .clearfix .ray-id" )
994
- and not driver .is_element_present ("#challenge-success-text" )
1002
+ and not driver .is_element_visible ("#challenge-success-text" )
995
1003
):
996
1004
blind = True
997
1005
caught = True
@@ -1214,7 +1222,7 @@ def _uc_gui_handle_captcha(driver, frame="iframe", ctype=None):
1214
1222
_uc_gui_handle_captcha_ (driver , frame = frame , ctype = ctype )
1215
1223
if (
1216
1224
driver .is_element_present (".footer .clearfix .ray-id" )
1217
- and not driver .is_element_present ("#challenge-success-text" )
1225
+ and not driver .is_element_visible ("#challenge-success-text" )
1218
1226
):
1219
1227
driver .uc_open_with_reconnect (driver .current_url , 3.8 )
1220
1228
_uc_gui_handle_captcha_ (driver , frame = frame , ctype = ctype )
0 commit comments