Skip to content

Unable to Fetch XHR Response Body with CDP #2731

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

You must be logged in to vote

Examples of fetching responses via CDP:

from rich.pretty import pprint
from seleniumbase import Driver

driver = Driver(uc=True, log_cdp=True)
try:
    url = "seleniumbase.io/apps/turnstile"
    driver.uc_open_with_reconnect(url, 2)
    driver.switch_to_frame("iframe")
    driver.uc_click("span.mark")
    driver.sleep(3)
    pprint(driver.get_log("performance"))
finally:
    driver.quit()
from rich.pretty import pprint
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "--uc", "--uc-cdp", "-s")

class CDPTests(BaseCase):
    def add_cdp_listener(self):
        # (To print everything, use "*"…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Comment options

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

Comment options

You must be logged in to vote
5 replies
@mdmintz
Comment options

@AnirbanPatragithub
Comment options

@mdmintz
Comment options

@AnirbanPatragithub
Comment options

@mdmintz
Comment options

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