Update CDP Mode examples
This commit is contained in:
parent
b8d308d3b4
commit
25365eface
|
@ -144,7 +144,7 @@ with SB(uc=True, test=True, locale_code="en", ad_block=True) as sb:
|
|||
sb.sleep(0.5)
|
||||
sb.scroll_into_view("a#advSearch")
|
||||
sb.sleep(0.5)
|
||||
sb.cdp.mouse_click("a#advSearch")
|
||||
sb.cdp.click("a#advSearch")
|
||||
sb.sleep(1.2)
|
||||
sb.cdp.click('img[src*="img/pokedex/detail/025.png"]')
|
||||
sb.cdp.assert_text("Pikachu", 'div[class*="title"]')
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
"""Using CDP Mode with PyAutoGUI to bypass CAPTCHAs."""
|
||||
from seleniumbase import SB
|
||||
|
||||
with SB(uc=True, test=True, locale_code="en", incognito=True) as sb:
|
||||
with SB(uc=True, test=True, locale_code="en", guest=True) as sb:
|
||||
url = "https://www.cloudflare.com/login"
|
||||
sb.activate_cdp_mode(url)
|
||||
sb.sleep(3)
|
||||
sb.uc_gui_handle_captcha() # PyAutoGUI press Tab and Spacebar
|
||||
sb.sleep(2)
|
||||
|
||||
with SB(uc=True, test=True, locale_code="en", incognito=True) as sb:
|
||||
with SB(uc=True, test=True, locale_code="en", guest=True) as sb:
|
||||
url = "https://www.cloudflare.com/login"
|
||||
sb.activate_cdp_mode(url)
|
||||
sb.sleep(2)
|
||||
sb.sleep(3)
|
||||
sb.uc_gui_click_captcha() # PyAutoGUI click. (Linux needs it)
|
||||
sb.sleep(2)
|
||||
|
|
|
@ -14,7 +14,7 @@ with SB(uc=True, test=True, locale_code="en", ad_block=True) as sb:
|
|||
sb.sleep(0.5)
|
||||
sb.scroll_into_view("a#advSearch")
|
||||
sb.sleep(0.5)
|
||||
sb.cdp.mouse_click("a#advSearch")
|
||||
sb.cdp.click("a#advSearch")
|
||||
sb.sleep(1.2)
|
||||
sb.cdp.click('img[src*="img/pokedex/detail/025.png"]')
|
||||
sb.cdp.assert_text("Pikachu", 'div[class*="title"]')
|
||||
|
|
Loading…
Reference in New Issue