-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
externalOutside SeleniumBase's scope. / Ask somewhere else.Outside SeleniumBase's scope. / Ask somewhere else.questionSomeone is looking for answersSomeone is looking for answers
Description
I am trying to retrieve and decode the response body of requests using SeleniumBase. Below is the code I am using:
from seleniumbase import Driver
driver = Driver(wire=True)
driver.get("https://seleniumbase.io/demo_page")
for request in driver.requests:
body_bytes = request.response.body
str_body = body_bytes.decode("utf-8")
print(request.url)
print(str_body)
driver.quit()
Problem:
- I want to extract the response body in a readable JSON or string format.
- The above implementation retrieves the body but may not be in a structured format.
Expected Behavior:
- The response body should be in a structured JSON or string format for easy processing.
How can I properly decode and parse the response body in JSON or as a readable string?
Thank you for your support!!
Metadata
Metadata
Assignees
Labels
externalOutside SeleniumBase's scope. / Ask somewhere else.Outside SeleniumBase's scope. / Ask somewhere else.questionSomeone is looking for answersSomeone is looking for answers