Skip to content

uc_open_with_cdp_mode(url) not finding session ID #3710

Answered by mdmintz
gehasa asked this question in Q&A
Discussion options

You must be logged in to vote

SB() is a context manager. Must be used within a with block:

from seleniumbase import SB

with SB(uc=True, test=True, ad_block=True) as sb:
    url = "https://www.browserscan.net/bot-detection"
    sb.activate_cdp_mode(url)
    sb.sleep(1)
    sb.cdp.flash("Test Results", duration=4)
    sb.sleep(1)
    sb.cdp.assert_element('strong:contains("Normal")')
    sb.cdp.flash('strong:contains("Normal")', duration=4, pause=4)

SeleniumBase/examples/cdp_mode/raw_browserscan.py

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gehasa
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants