2

I use curl to get html code of webpage for server side.

This is a part of my code

curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); 
   curl_setopt($this->ch, CURLOPT_URL, $this->url); 
   curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true); 
   curl_setopt($this->ch, CURLOPT_BINARYTRANSFER, $this->binary);

but it can not get html code that include ajax or somthing like this web page.

look at <div id="pdImgs"></div>

when I use my script it show nothing in that but the truth it has html code between div.

How can I get that by curl or other?

4

1 回答 1

0

标签由 Javascript 或 AJAX 动态加载。所以源代码中的标签是空的。由于 curl 无法执行异步加载数据所需的 javascript。因此,您将标签变为空。

于 2013-05-31T18:29:21.583 回答