@@ -612,6 +612,7 @@ def uc_open_with_cdp_mode(driver, url=None):
612
612
cdp .save_cookies = CDPM .save_cookies
613
613
cdp .load_cookies = CDPM .load_cookies
614
614
cdp .clear_cookies = CDPM .clear_cookies
615
+ cdp .sleep = CDPM .sleep
615
616
cdp .bring_active_window_to_front = CDPM .bring_active_window_to_front
616
617
cdp .bring_to_front = CDPM .bring_active_window_to_front
617
618
cdp .get_active_element = CDPM .get_active_element
@@ -684,6 +685,7 @@ def uc_open_with_cdp_mode(driver, url=None):
684
685
cdp .select_if_unselected = CDPM .select_if_unselected
685
686
cdp .unselect_if_selected = CDPM .unselect_if_selected
686
687
cdp .is_checked = CDPM .is_checked
688
+ cdp .is_selected = CDPM .is_selected
687
689
cdp .is_element_present = CDPM .is_element_present
688
690
cdp .is_element_visible = CDPM .is_element_visible
689
691
cdp .wait_for_element_visible = CDPM .wait_for_element_visible
@@ -699,6 +701,8 @@ def uc_open_with_cdp_mode(driver, url=None):
699
701
cdp .assert_url_contains = CDPM .assert_url_contains
700
702
cdp .assert_text = CDPM .assert_text
701
703
cdp .assert_exact_text = CDPM .assert_exact_text
704
+ cdp .assert_true = CDPM .assert_true
705
+ cdp .assert_false = CDPM .assert_false
702
706
cdp .scroll_into_view = CDPM .scroll_into_view
703
707
cdp .scroll_to_y = CDPM .scroll_to_y
704
708
cdp .scroll_to_top = CDPM .scroll_to_top
@@ -1167,7 +1171,12 @@ def _uc_gui_click_captcha(
1167
1171
frame = "%s div" % frame
1168
1172
elif (
1169
1173
driver .is_element_present ('[name*="cf-turnstile-"]' )
1170
- and driver .is_element_present ('[class*=spacer] + div div' )
1174
+ and driver .is_element_present ("#challenge-form div > div" )
1175
+ ):
1176
+ frame = "#challenge-form div > div"
1177
+ elif (
1178
+ driver .is_element_present ('[name*="cf-turnstile-"]' )
1179
+ and driver .is_element_present ("[class*=spacer] + div div" )
1171
1180
):
1172
1181
frame = '[class*=spacer] + div div'
1173
1182
elif (
@@ -1240,8 +1249,8 @@ def _uc_gui_click_captcha(
1240
1249
return
1241
1250
try :
1242
1251
if ctype == "g_rc" and not driver .is_connected ():
1243
- x = (i_x + 32 ) * width_ratio
1244
- y = (i_y + 34 ) * width_ratio
1252
+ x = (i_x + 29 ) * width_ratio
1253
+ y = (i_y + 35 ) * width_ratio
1245
1254
elif visible_iframe :
1246
1255
selector = "span"
1247
1256
if ctype == "g_rc" :
@@ -1256,8 +1265,8 @@ def _uc_gui_click_captcha(
1256
1265
y = i_y + element .rect ["y" ] + (element .rect ["height" ] / 2.0 )
1257
1266
y += 0.5
1258
1267
else :
1259
- x = (i_x + 34 ) * width_ratio
1260
- y = (i_y + 34 ) * width_ratio
1268
+ x = (i_x + 32 ) * width_ratio
1269
+ y = (i_y + 32 ) * width_ratio
1261
1270
if driver .is_connected ():
1262
1271
driver .switch_to .default_content ()
1263
1272
except Exception :
@@ -1497,6 +1506,7 @@ def _uc_gui_handle_captcha_(driver, frame="iframe", ctype=None):
1497
1506
tab_count += 1
1498
1507
time .sleep (0.027 )
1499
1508
active_element_css = js_utils .get_active_element_css (driver )
1509
+ print (active_element_css )
1500
1510
if (
1501
1511
active_element_css .startswith (selector )
1502
1512
or active_element_css .endswith (" > div" * 2 )
@@ -1514,7 +1524,10 @@ def _uc_gui_handle_captcha_(driver, frame="iframe", ctype=None):
1514
1524
except Exception :
1515
1525
return
1516
1526
if (
1517
- driver .is_element_present (".footer .clearfix .ray-id" )
1527
+ (
1528
+ driver .is_element_present (".footer .clearfix .ray-id" )
1529
+ or driver .is_element_present ("script[data-cf-beacon]" )
1530
+ )
1518
1531
and hasattr (sb_config , "_saved_cf_tab_count" )
1519
1532
and sb_config ._saved_cf_tab_count
1520
1533
):
0 commit comments