Skip to content
Advertisement

Is it possible to extract any Header value from the Network panel on google chrome developer tools with selenium?

I want to access the value of one of the Headers under the Network panel on google chrome developer tools with selenium.

I’m able to navigate and access the json for Networks panel using ChromeOptions in Selenium. But i also need to extract a value of any of the Headers for any Name. For ex. I manually navigated to www.google.com, press F12, click on any name from the left column and for that particular name, in the right hand side, i need to access the “Request URL” under Headers section.

Using the below code, i’m able to access the Networks panel:

JavaScript

Is it possible through Selenium or also through any Java program?

Advertisement

Answer

you need to use LogType.performance to get that. It will contain a lot of info and you can filter accordingly.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement