In fact, grab Ajax asynchronous content of the page and catch the ordinary page is not very different. Ajax simply makes an asynchronous HTTP request, as long as it uses firebug-like tools to find the requested backend service URL and value-passing parameters, and then fetches the URL parameters.
Using Firebug's Network Tools
If you are grabbing a page, the data that is not displayed in the content is a bunch of JS code.
Code
$cookie _file=tempnam ('./temp ', ' Cookie '); $ch = Curl_init (); $url 1 = "http://www.cdut.edu.cn/default.html"; curl_ Setopt ($ch, Curlopt_url, $url 1); curl_setopt ($ch, curlopt_http_version,curl_http_version_1_1); curl_setopt ($ch, curlopt_header,0); curl_setopt ($ch, curlopt_returntransfer,1); curl_setopt ($ch, curlopt_followlocation,1); curl_ Setopt ($ch, curlopt_encoding, ' gzip '); Add gzip parse//Set file curl_setopt ($ch, Curlopt_cookiejar, $cookie _file) to save cookie information after connection ends; $content =curl_exec ($ch); curl_ Close ($ch); $ch 3 = Curl_init (); $url 3 = "Http://www.cdut.edu.cn/xww/dwr/call/plaincall/portalAjax.getNewsXml.dwr"; $ Curlpost = "callcount=1&page=/xww/type/1000020118.html&httpsessionid=12a9b726e6a2d4d3b09de7952b2f282c &scriptsessionid=295315b4b4141b09da888d3a3adb8faa658&c0-scriptname=portalajax&c0-methodname= Getnewsxml&c0-id=0&c0-param0=string:10000201&c0-param1=string:1000020118&c0-param2=string:news _&c0-param3=number:5969&c0-param4=number:1&c0-param5=null:null&c0-param6=null:Null&batchid=0 "; curl_setopt ($ch 3,curlopt_url, $url 3); curl_setopt ($ch 3,curlopt_post,1); curl_setopt ($ch 3, Curlopt_postfields, $curlPost);//Set the file curl_setopt ($ch 3,curlopt_cookiefile, $cookie _file) that holds cookie information after the connection is completed; $content 1=curl_exec ($ch 3); Curl_close ($ch 3);