Maybe someone knows how to get data from Response in DevTools with Selenium?
https://i.stack.imgur.com/T9ALa.png
I don`t know how to get response data.
Maybe someone knows how to get data from Response in DevTools with Selenium?
https://i.stack.imgur.com/T9ALa.png
I don`t know how to get response data.
It's as easy as this:
response = driver.execute_script(javascript)
Now response
has what was returned by the script!
What you are asking for is the HTTP response of a specific request happening in the website. Getting performance info is possible by executing javascript but you won't be able to get the response of all the requests which is happening in the page, atleast from what I know.
However, if you already know the exact request (or you can get it by this way), you can get the response easily by simulating that request in python. Here is an example -
import requests
headers = {
"your_header_keys" : "your_header_values"
}
data = [
"your_request_body"
]
response = requests.post('your_url', headers=headers, data=data)