简体   繁体   中英

Reading network traffic from the browser using Java code

Folks,

I was looking for Java capability of reading thru the network tab. I had a task of hitting a URL in the browser, reading and validate some tags which are fired on page load. I Know to fetch the View Source Data of the page, but not sure on getting network tab data.

example:

Opening a URL in chrome browser and watching Network tab in the developer tool, i see bunch of Get requests(tags,js etc) getting fired & need to capture this data.

I wanted to know which is the best way to achieve this and great if any code snippet is available.

Cheers

You can use HttpClient to work on api testing. There are many tutorials to work on api testing using Java. For starter you can read about Apache Http client .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM