简体   繁体   中英

How can I programmatically see what requests (e.g. API or resource requests) are being made by a website

In Chrome, you can go to developer tools >.network tab to see all the requests the website is making.

What would be a good way to get the list of these requests programmatically? I guess I can grab the content of the site, grab all the URLs that are in the page and parse them, but that seems a bit tedious, especially if the requests are being made from a JS file.

Is there an easier way?

On the server side, there's the access log that will have request information for all requests made against it. It might take some configuration to save all the fields you want to use (method, POST data, cookies, time, remote client address) but this is more efficient than trying to do things from a browser. Each web server has a different way of configuring its log files.

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