Skip to content

Commit 25365ef

Browse files
committedFeb 24, 2025
Update CDP Mode examples
1 parent b8d308d commit 25365ef

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
 

‎examples/cdp_mode/ReadMe.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ with SB(uc=True, test=True, locale_code="en", ad_block=True) as sb:
144144
sb.sleep(0.5)
145145
sb.scroll_into_view("a#advSearch")
146146
sb.sleep(0.5)
147-
sb.cdp.mouse_click("a#advSearch")
147+
sb.cdp.click("a#advSearch")
148148
sb.sleep(1.2)
149149
sb.cdp.click('img[src*="img/pokedex/detail/025.png"]')
150150
sb.cdp.assert_text("Pikachu", 'div[class*="title"]')

‎examples/cdp_mode/raw_cf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
"""Using CDP Mode with PyAutoGUI to bypass CAPTCHAs."""
22
from seleniumbase import SB
33

4-
with SB(uc=True, test=True, locale_code="en", incognito=True) as sb:
4+
with SB(uc=True, test=True, locale_code="en", guest=True) as sb:
55
url = "https://www.cloudflare.com/login"
66
sb.activate_cdp_mode(url)
77
sb.sleep(3)
88
sb.uc_gui_handle_captcha() # PyAutoGUI press Tab and Spacebar
99
sb.sleep(2)
1010

11-
with SB(uc=True, test=True, locale_code="en", incognito=True) as sb:
11+
with SB(uc=True, test=True, locale_code="en", guest=True) as sb:
1212
url = "https://www.cloudflare.com/login"
1313
sb.activate_cdp_mode(url)
14-
sb.sleep(2)
14+
sb.sleep(3)
1515
sb.uc_gui_click_captcha() # PyAutoGUI click. (Linux needs it)
1616
sb.sleep(2)

‎examples/cdp_mode/raw_pokemon.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
sb.sleep(0.5)
1515
sb.scroll_into_view("a#advSearch")
1616
sb.sleep(0.5)
17-
sb.cdp.mouse_click("a#advSearch")
17+
sb.cdp.click("a#advSearch")
1818
sb.sleep(1.2)
1919
sb.cdp.click('img[src*="img/pokedex/detail/025.png"]')
2020
sb.cdp.assert_text("Pikachu", 'div[class*="title"]')

0 commit comments

Comments
 (0)
Please sign in to comment.