跳转到主内容
趣航编程网 - 趣学编程,启航技术之路!

抓取url跟网页内容

抓取url和网页内容由于技术不够,整天在逛论坛。

看到许多关于抓取网页内容(file_get_contents)和抓取url(这个不知道用什么)对这个听感兴趣。望大神指点下这是怎么回事?最好能帮我整个源码嘎嘎。叫我参考下。

分享到:

Baidu Button BEGIN更多Baidu Button END------解决方案--------------------$url='http://www.iheima.com/';$con=file_get_contents($url);if ($con){preg_match_all('/ (.+).*(.+)/isU', $con, $temp,PREG_SET_ORDER);foreach ($temp as $key=> $v){$title=$v[2];$v_url=$v[1];$des=$v[3];$con_url=file_get_contents($v_url);if ($con_url){$tags='';preg_match('/keywords" content="(.+)"/isU', $con_url,$tags);$tags=trim($tags[1],',');preg_match('/class="txs_Content".*>(.+)/isU', $con_url,$txt);$txt=$txt[1];}}} 够清楚了吧

相关文章