开发者

Monitor AJAX calls via cURL

开发者 https://www.devze.com 2022-12-23 06:11 出处:网络
Is it possible to monitor a page\'s AJAX calls via cURL in PHP? For example, if I connect to a website that uses lots of AJAX to pull content, can I connec开发者_StackOverflow中文版t to the site via c

Is it possible to monitor a page's AJAX calls via cURL in PHP? For example, if I connect to a website that uses lots of AJAX to pull content, can I connec开发者_StackOverflow中文版t to the site via cURL, have it wait a couple of seconds until the AJAX requests are done and analyze the request that the site made?


Basically, no. cURL is not a replacement for a browser. It simply downloads the HTML file. The browsers will take that HTML, read for external scripts (js/css/images), download them, and then finally execute the JavaScript according to the browser's specific engine.


Try Fiddler FiddlerTool


Firebug lets you easily monitor Ajax calls from the browser. All XMLHttpRequests show up in the Console and Net tabs with the ability to see both the request and response.

0

精彩评论

暂无评论...
验证码 换一张
取 消