@@ -612,6 +612,7 @@ def uc_open_with_cdp_mode(driver, url=None):
612612 cdp .save_cookies = CDPM .save_cookies
613613 cdp .load_cookies = CDPM .load_cookies
614614 cdp .clear_cookies = CDPM .clear_cookies
615+ cdp .sleep = CDPM .sleep
615616 cdp .bring_active_window_to_front = CDPM .bring_active_window_to_front
616617 cdp .bring_to_front = CDPM .bring_active_window_to_front
617618 cdp .get_active_element = CDPM .get_active_element
@@ -684,6 +685,7 @@ def uc_open_with_cdp_mode(driver, url=None):
684685 cdp .select_if_unselected = CDPM .select_if_unselected
685686 cdp .unselect_if_selected = CDPM .unselect_if_selected
686687 cdp .is_checked = CDPM .is_checked
688+ cdp .is_selected = CDPM .is_selected
687689 cdp .is_element_present = CDPM .is_element_present
688690 cdp .is_element_visible = CDPM .is_element_visible
689691 cdp .wait_for_element_visible = CDPM .wait_for_element_visible
@@ -699,6 +701,8 @@ def uc_open_with_cdp_mode(driver, url=None):
699701 cdp .assert_url_contains = CDPM .assert_url_contains
700702 cdp .assert_text = CDPM .assert_text
701703 cdp .assert_exact_text = CDPM .assert_exact_text
704+ cdp .assert_true = CDPM .assert_true
705+ cdp .assert_false = CDPM .assert_false
702706 cdp .scroll_into_view = CDPM .scroll_into_view
703707 cdp .scroll_to_y = CDPM .scroll_to_y
704708 cdp .scroll_to_top = CDPM .scroll_to_top
@@ -1167,7 +1171,12 @@ def _uc_gui_click_captcha(
11671171 frame = "%s div" % frame
11681172 elif (
11691173 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" )
11711180 ):
11721181 frame = '[class*=spacer] + div div'
11731182 elif (
@@ -1240,8 +1249,8 @@ def _uc_gui_click_captcha(
12401249 return
12411250 try :
12421251 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
12451254 elif visible_iframe :
12461255 selector = "span"
12471256 if ctype == "g_rc" :
@@ -1256,8 +1265,8 @@ def _uc_gui_click_captcha(
12561265 y = i_y + element .rect ["y" ] + (element .rect ["height" ] / 2.0 )
12571266 y += 0.5
12581267 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
12611270 if driver .is_connected ():
12621271 driver .switch_to .default_content ()
12631272 except Exception :
@@ -1497,6 +1506,7 @@ def _uc_gui_handle_captcha_(driver, frame="iframe", ctype=None):
14971506 tab_count += 1
14981507 time .sleep (0.027 )
14991508 active_element_css = js_utils .get_active_element_css (driver )
1509+ print (active_element_css )
15001510 if (
15011511 active_element_css .startswith (selector )
15021512 or active_element_css .endswith (" > div" * 2 )
@@ -1514,7 +1524,10 @@ def _uc_gui_handle_captcha_(driver, frame="iframe", ctype=None):
15141524 except Exception :
15151525 return
15161526 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+ )
15181531 and hasattr (sb_config , "_saved_cf_tab_count" )
15191532 and sb_config ._saved_cf_tab_count
15201533 ):
0 commit comments