For example, if I request Baidu, I want to know the resources I have requested in total, including images, JS, and CSS, but I don't want FILE_GET_CONTENT to use this and then use regular expression analysis, is there a better way? For example, if I request Baidu, I want to know the resources I have requested in total, including images, JS, and CSS, but I don't want FILE_GET_CONTENT to use this and then use regular expression analysis, is there a better way?
Reply content:
For example, if I request Baidu, I want to know the resources I have requested in total, including images, JS, and CSS, but I don't want FILE_GET_CONTENT to use this and then use regular expression analysis, is there a better way?
This method is not available. Maybe you can find an encapsulated object to meet your needs, but the object must be analyzed internally for statistics.
As a matter of fact, you will know that your intention is not logical. What about the browser? Isn't it the first step to get the html source code and then execute the code line by line to request resources such as css, js, and image? This is the logic that conforms to the laws of things. It is like asking you how many floors are there in a building. The only way is to count them. Maybe some instruments can calculate them, however, the working principle of the instrument is also a layer-by-layer number.
The program is based on logic. When developing functions, you don't need the wheel built by others, but it doesn't mean that you can erase the logic represented by that wheel.
Either way, you have to do some work.
We recommend that you use simplehtmldom.