hy i'使用简单的html dom抓取 我的语言是......
1.如何设置简单的html dom如
"CURLOPT_RETURNTRANSFER"<br>
"CURLOPT_CONNECTTIMEOUT"<br>
"CURLOPT_TIMEOUT"<br>
"CURLOPT_USERAGENT"<br>
"CURLOPT_RETURNTRANSFER"<br>
"CURLOPT_MAXREDIRS"<br>
例如我有代码
include "inc/simple_html_dom.php";
$html = new simple_html_dom();
$html = file_get_html('http://example.com/');
foreach($items as $i => $post) {
// get the img
$img = $post->find('img', 0)->src;
$url = $post->find('a', 0)->href;
}