0
我想放弃使用curl
和preg_match
一个网站表Preg_match不在内部表中工作?
我的网址http://hosts-file.net/?s=Browse&f=EMD
我卷曲
$url = 'http://hosts-file.net/?s=Browse&f=EMD';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15"));
curl_setopt($ch, CURLOPT_NOBODY, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body= curl_exec ($ch);
curl_close ($ch);
我需要放弃一个表。
我preg_match
功能如下
preg_match_all('/<table class=\"main_normal(.*?)\">(.*?)<\/table>/s',$body,$vv,PREG_SET_ORDER);
给出,但它返回空数组只
请指引我
请使用dom解析来抓取html。 – DevZer0
请给我任何例子 –
DOMDocument,DOMXPath,simple_html_dom,phpquery – DevZer0