-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --log-cdp
/ log_cdp=True
options for capturing CDP logs
#2220
Comments
This was resolved in |
That's GREAT!! |
@mdmintz so if i create a driver as follows from seleniumbase import Driver
driver = Driver(uc=True, incognito=True, uc_cdp_events=True) How can I look at a specific request and the response body for that request? |
#2050 (comment) - To get the response body of a request, first get the |
@mdmintz thanks so much! I'm trying to do something simple to debug... URL = # define here
def callback(data):
request_id = data['requestId']
print(request_id)
print(data)
driver.add_cdp_listener("*", callback)
driver.get(URL) When I just use the callback to With the command you also suggested
Where would I actually be able to look at the response body? When running the command would I expect something returned in my console/script? I basically want to store the response body for that particular request (asssuming I can find it) to a variable to then decode. |
See https://stackoverflow.com/a/52636871/7058266 for details. |
Add
--log-cdp
/log_cdp=True
options for capturing CDP logsIf enabled, this happens:
Then you can do something like this to display those logs: (Eg.
driver.get_log("performance")
)Note that UC Mode also has separate
--uc-cdp
/uc_cdp=True
options. That works differently. (See SeleniumBase/examples/uc_cdp_events.py for an example of that.)The text was updated successfully, but these errors were encountered: