python - 如何用java获取一个网站的网络传输中的request URL。
PHPz
PHPz 2017-04-18 09:38:51
0
2
361

类似于抓包。我们在chrome开发者工具中看到Network传输的请求,可以用java获取到嘛?

PHPz
PHPz

学习是最好的投资!

reply all(2)
小葫芦

Java is a programming language, not a packet capture and analysis tool.
If those URLs originally exist in the web page, you can use regular expressions to match them~
If the URL is dynamically generated, it will be more laborious to analyze the algorithm.


If you just want to get the video file, you can find it from the browser's cache folder.
Chrome’s cache folder is generally called Cache
First clear the cache folder, then watch the video. After the video buffersis completed, copy the files in the cache folder and change the extension to the corresponding format.
For example: .mp4 ; .flv

巴扎黑

It can be obtained, if you use the springMVC framework
//The current requested url
String url = request.getRequestURL().toString();
//query is everything after the question mark in the url
String queryString = request.getQueryString();
In addition, the content of the request header can also be obtained, please see Du Niang for details

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template