写的一个PHP代码(test.php):<?php
$url = "http://www.baidu.com/";
$contents = file_get_contents($url);
echo $contents;?> 如何把抓取的这个网页数据mysql数据库中呢? 表是Page 字段1:Pageid | 字段2:Pagetext
求代码
$url = "http://www.baidu.com/";
$contents = file_get_contents($url);
echo $contents;?> 如何把抓取的这个网页数据mysql数据库中呢? 表是Page 字段1:Pageid | 字段2:Pagetext
求代码
值都有了,字段也有了
<? php$url = "http://www.baidu.com/";
$contents = file_get_contents($url);
echo $contents; insert into page (null) values ('Pagetext');?>是这样吗?
$sql="insert into `Page` values ('','$contents')";
实在不知道格式怎么写!
<? php$url = "http://www.baidu.com/";
$contents = file_get_contents($url);
echo $contents;
?>在这个代码里怎么插入?
$contents = file_get_contents($url);
//echo $contents;
//数据库链接
mysql_conn...
//插入数据库
$SQL=""INSERT INTO page (Pagetext) VALUES('".$contents."');";
mysql_query($SQL);
?>
<? php$url = "http://www.baidu.com/";
$contents = file_get_contents($url);
echo $contents; insert into page (pagetext) values ('$contents');?>这样么?
$contents = file_get_contents($url);
echo $contents;
// your host
$host = "localhost";
// your database username
$username = "root";
// your database password
$password = "1234";
//your database name
$db_name = "test";
$my_connect = mysql_connect($host, $username, $password);
if ($my_connect && $username && $password) {
mysql_select_db($db_name, $my_connect);
$sql = "insert into page (pagetext) values ('".$contents."');";
mysql_query($sql);
}
mysql_close($my_connect);盲碼 試試吧
还是只能存字符串?
把html进行压缩成gzip存储呢?
<?php
$url = "http://qzone.qq.com/";
$contents = file_get_contents($url);
echo $contents;?>
比如这样,这样直接截取到的是网页,直接存储吗?msyql_conn(localhost,root,"",5432);
mysql_select_db("lookdb");
mysql_query("set name gbk");
$sql="";
mysql_query($sql);$SQL="INSERT INTO text (old_text) VALUES('".$contents."')";
mysql_query($SQL);第2种抓取网页信息:
<?php
$url='http://www.hao123.com';
$lines_array=file($url);
$lines_string=implode('',$lines_array);
echo htmlspecialchars($lines_string);
?>还是抓取源文件,把源文件进行分割存储呢?我们里比如做服务器,抓取到的信息,存储到sqlite里或者是mysql里该怎么做?第一次存储html这样,不知道怎么做。求指导下。
对噢,还是用正则,存储报错,一直报第3行错误:
这是第3行代码:
$url = "http://qzone.qq.com/"; 还在改
Fatal error: Call to undefined function msyql_conn() in D:\PHPnow\htdocs\test28.php on line 7
msyql_conn(localhost,root,'');服务器是:localhost,用户是root,密码为空,
还有哪里错了吗?
服务器是:localhost,用户是root,密码为空:<?php$url = "http://www.baidu.com/";
$contents = file_get_contents($url);
echo $contents; msyql_connect(localhost,root,'');
mysql_select_db("lookdb");
mysql_query("set name gbk");
$sql="";
mysql_query($sql);$SQL="INSERT INTO page (pagetext) VALUES('".$contents."')";
mysql_query($SQL);?>
<?php
$url='http://www.hao123.com';
$lines_array=file($url);
$lines_string=implode('',$lines_array);
echo htmlspecialchars($lines_string);msyql_connect(localhost,root,'');
mysql_select_db("lookdb");
mysql_query("set name UTF8");
$sql="";
mysql_query($sql);
$SQL="INSERT INTO text (old_text) VALUES('".$contents."')";
mysql_query($SQL);?>
正则是应该是/<h1>(.*?)</table>
该怎么写进去,求高手帮助,没PHP基本的新手+菜鸟啊。。
<?php $url='http://www.baidu.com/';
$lines_array=file($url);
$lines_string=implode('',$lines_array);
echo htmlspecialchars($lines_string);preg_match_all('/<h1>(.*?)</table>',$lines_array,$match);
print_r($match);msyql_connect(localhost,root,'');
mysql_select_db("lookdb");
mysql_query("set name gbk");
$sql="";
mysql_query($sql);$SQL="INSERT INTO page (pagetext) VALUES('".$lines_array."')";
mysql_query($SQL);?>
各位大爷牛人看看错在哪里?小弟没基础的PHP新手啊,急着求解呢,摆脱了
在baidu.com并没有<h1> 的代码部分.也没有看到</table>的部分...
<?php $url='http://www.test32.com/';
$lines_array=file($url);
$lines_string=implode('',$lines_array);
echo htmlspecialchars($lines_string);preg_match_all('/<h1>(.*?)</table>',$lines_array,$match);
print_r($match);msyql_connect(localhost,root,'');
mysql_select_db("lookdb");
mysql_query("set name gbk");
$sql="";
mysql_query($sql);$SQL="INSERT INTO page (pagetext) VALUES('".$lines_array."')";
mysql_query($SQL);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-sg" lang="zh-sg" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="一氧化碳,光气,常见危险品中毒急救及应急处理措施,常见危险品处置方法,氯气" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch_desc.php" title="(中文(简体))" />
<link title="Creative Commons" type="application/rdf+xml" href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&action=creativecommons" rel="meta" />
<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html" />
<title>一氧化碳</title>
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/skins/monobook/main.css?42b"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="/skins/common/commonPrint.css?42b" />
<link rel="stylesheet" type="text/css" media="handheld" href="/skins/monobook/handheld.css?42b" />
<!--[if lt IE 5.5000]><style type="text/css">@import "/skins/monobook/IE50Fixes.css?42b";</style><![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "/skins/monobook/IE55Fixes.css?42b";</style><![endif]-->
<!--[if IE 6]><style type="text/css">@import "/skins/monobook/IE60Fixes.css?42b";</style><![endif]-->
<!--[if IE 7]><style type="text/css">@import "/skins/monobook/IE70Fixes.css?42b";</style><![endif]-->
<!--[if lt IE 7]><script type="text/javascript" src="/skins/common/IEFixes.js?42b"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<script type= "text/javascript">/*<![CDATA[*/
var skin = "monobook";
var stylepath = "/skins";
var wgArticlePath = "/index.php/$1";
var wgScriptPath = "";
var wgServer = "http://localhost";
var wgCanonicalNamespace = "";
var wgCanonicalSpecialPageName = false;
var wgNamespaceNumber = 0;
var wgPageName = "一氧化碳";
var wgTitle = "一氧化碳";
var wgArticleId = "6487";
var wgIsArticle = true;
var wgUserName = null;
var wgUserLanguage = "zh-sg";
var wgContentLanguage = "zh-sg";
var wgBreakFrames = false;
var wgCurRevisionId = "6487";
/*]]>*/</script>
<script type="text/javascript" src="/skins/common/wikibits.js?42b"><!-- wikibits js --></script>
<script type="text/javascript" src="/index.php?title=-&action=raw&gen=js"><!-- site js --></script>
<style type="text/css">/*<![CDATA[*/
@import "/index.php?title=Common.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";
@import "/index.php?title=Monobook.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";
@import "/index.php?title=-&action=raw&gen=css&maxage=18000";
/*]]>*/</style>
<!-- Head Scripts -->
</head>
<body class="ns-0 ltr page-一氧化碳">
<div id="globalWrapper">
<div id="column-content">
<div id="content">
<a name="top" id="top"></a>
<h1 class="firstHeading">一氧化碳</h1>
<div id="bodyContent">
<h3 id="siteSub">取自 AEED</h3>
<div id="contentSub"></div>
<div id="jump-to-nav">跳转到: <a href="#column-one">导航</a>, <a href="#searchInput">搜索</a></div> <!-- start content -->
<a href="/index.php/%E5%B8%B8%E8%A7%81%E5%8D%B1%E9%99%A9%E5%93%81%E5%A4%84%E7%BD%AE%E6%96%B9%E6%B3%95" title="常见危险品处置方法">常见危险品处置方法</a>-><a href="/index.php/%E5%B8%B8%E8%A7%81%E5%8D%B1%E9%99%A9%E5%93%81%E4%B8%AD%E6%AF%92%E6%80%A5%E6%95%91%E5%8F%8A%E5%BA%94%E6%80%A5%E5%A4%84%E7%90%86%E6%8E%AA%E6%96%BD" title="常见危险品中毒急救及应急处理措施">常见危险品中毒急救及应急处理措施</a>-><br /><table width="800" align="center" cellpadding="20">
<tr>
<td height="30" align="left" valign="middle" bgcolor="EFEFEF">现在位置:<a href="/index.php/%E6%B0%AF%E6%B0%94" title="氯气">上一页</a> > <strong>一氧化碳</strong> > <a href="/index.php/%E5%85%89%E6%B0%94" title="光气">下一页</a></td>
</tr>
<tr bgcolor="#FFFFFF"><td align="center"><p class="STYLE1"> </p>
<p class="STYLE1">(四)一氧化碳 </p>
<p class="STYLE1"> </p></td>
</tr>
<tr><td align="left" bgcolor="#FFFFFF">
<table><tr><td>
<p><strong>1、中毒急救措施 </strong><br />
使患者离开污染区,如呼吸停止,则应立即口对鼻人工呼吸,恢复正常后,给患者吸氧或高压氧。昏迷复苏病人,应注意脑水肿的出现,有脑膜刺激症候及早用甘露醇或高能葡萄糖等脱水治疗。<br />
<br />
<strong>2、应急处理措施</strong> <br />
迅速撤离泄漏污染区人员至上风处,并立即隔离150m,严格限制出入。切断火源。建议应急处理人员戴自给正压式呼吸器,穿消防防护服。尽可能切断泄漏源。合理通风,加速扩散。喷雾状水稀释、溶解。构筑围堤或挖坑收容产生的大量废水。如有可能,将漏出气体用排风机送至空旷地方或装设适当喷头烧掉。也可以用管路导至炉中、凹地焚之。漏气容器要妥善处理,修复、检验后再用。 </p>
</td></tr></table>
</td></tr>
</table>
<!-- Saved in parser cache with key wikidb:pcache:idhash:6487-0!1!0!!zh-sg!2 and timestamp 20120320084732 -->
<div class="printfooter">
取自"<a href="http://localhost/index.php/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">http://localhost/index.php/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3</a>"</div>
<!-- end content -->
<div class="visualClear"></div>
</div>
</div>
</div>
<div id="column-one">
<div id="p-cactions" class="portlet">
<h5>查看</h5>
<div class="pBody">
<ul>
<li id="ca-nstab-main" class="selected"><a href="/index.php/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">条目</a></li>
<li id="ca-talk" class="new"><a href="/index.php?title=Talk:%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&action=edit">讨论</a></li>
<li id="ca-edit"><a href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&action=edit">编辑</a></li>
<li id="ca-history"><a href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&action=history">历史</a></li>
</ul>
</div>
</div>
<div class="portlet" id="p-personal">
<h5>个人工具</h5>
<div class="pBody">
<ul>
<li id="pt-login"><a href="/index.php?title=Special:Userlogin&returnto=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">登录/注册</a></li>
</ul>
</div>
</div>
<div class="portlet" id="p-logo">
<a style="background-image: url(C:/PHPnow/htdocs/images/logo.png);" href="/index.php/%E9%A6%96%E9%A1%B5" title="首页"></a>
</div>
<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
<div class='portlet' id='p-.E7.9F.A5.E8.AF.86.E5.BA.93'>
<h5>知识库</h5>
<div class='pBody'>
<ul>
<li id="n-.E7.9F.A5.E8.AF.86.E5.BA.93"><a href="/index.php/%E7%9F%A5%E8%AF%86%E5%BA%93">知识库</a></li>
<li id="n-.E5.8D.B1.E9.99.A9.E5.93.81.E7.9F.A5.E8.AF.86.E5.BA.93"><a href="/index.php/%E5%8D%B1%E9%99%A9%E5%93%81%E7%9F%A5%E8%AF%86%E5%BA%93">危险品知识库</a></li>
<li id="n-.E5.B8.B8.E8.A7.81.E5.8D.B1.E9.99.A9.E5.93.81.E5.A4.84.E7.BD.AE.E6.96.B9.E6.B3.95"><a href="/index.php/%E5%B8%B8%E8%A7%81%E5%8D%B1%E9%99%A9%E5%93%81%E5%A4%84%E7%BD%AE%E6%96%B9%E6%B3%95">常见危险品处置方法</a></li>
<li id="n-.E7.8E.AF.E5.A2.83.E6.A0.87.E5.87.86.E5.BA.93"><a href="/index.php/%E7%8E%AF%E5%A2%83%E6%A0%87%E5%87%86%E5%BA%93">环境标准库</a></li>
<li id="n-.E7.8E.AF.E5.A2.83.E6.B3.95.E5.BE.8B.E6.B3.95.E8.A7.84.E5.BA.93"><a href="/index.php/%E6%B3%95%E5%BE%8B%E6%B3%95%E8%A7%84">环境法律法规库</a></li>
</ul>
</div>
</div>
<div id="p-search" class="portlet">
<h5><label for="searchInput">搜索</label></h5>
<div id="searchBody" class="pBody">
<form action="/index.php/Special:Search" id="searchform"><div>
<input id="searchInput" name="search" type="text" accesskey="f" value="" />
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="进入" />
<input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="搜索" />
</div></form>
</div>
</div>
<div class="portlet" id="p-tb">
<h5>工具箱</h5>
<div class="pBody">
<ul>
<li id="t-whatlinkshere"><a href="/index.php/Special:Whatlinkshere/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">链入页面</a></li>
<li id="t-recentchangeslinked"><a href="/index.php/Special:Recentchangeslinked/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">链出更改</a></li>
<li id="t-upload"><a href="/index.php/Special:Upload">上传文件</a></li>
<li id="t-specialpages"><a href="/index.php/Special:Specialpages">特殊页面</a></li>
<li id="t-print"><a href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&printable=yes">可打印版</a></li> <li id="t-permalink"><a href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&oldid=6487">永久链接</a></li> </ul>
</div>
</div>
</div><!-- end of the left (by default at least) column -->
<div class="visualClear"></div>
<div id="footer">
<div id="f-poweredbyico"><a href="http://www.mediawiki.org/"><img src="/skins/common/images/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" /></a></div>
<div id="f-copyrightico"><a href="http://www.gnu.org/copyleft/fdl.html"><img src="/skins/common/images/gnu-fdl.png" alt='GNU Free Documentation License 1.2' /></a></div>
<ul id="f-list">
<li id="lastmod"> 本页面最后修订:2012年1月25日,09:12.</li>
<li id="viewcount">本页面被访问 16 次。</li>
<li id="copyright">本站内容在<a href="http://www.gnu.org/copyleft/fdl.html" class="external " title="http://www.gnu.org/copyleft/fdl.html" rel="nofollow">GNU Free Documentation License 1.2</a>下发布。</li>
<li id="privacy"><a href="/index.php/AEED:%E9%9A%90%E7%A7%81%E7%AD%96%E7%95%A5" title="隐私策略">隐私策略</a></li>
<li id="about"><a href="/index.php/AEED:%E5%85%B3%E4%BA%8E" title="关于">关于AEED</a></li>
<li id="disclaimer"><a href="/index.php/AEED:%E5%85%8D%E8%B4%A3%E5%A3%B0%E6%98%8E" title="免责声明">免责声明</a></li>
</ul>
</div>
<script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script>
</div>
<!-- Served by localhost in 0.253 secs. --></body></html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-sg" lang="zh-sg" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="一氧化碳,光气,常见危险品中毒急救及应急处理措施,常见危险品处置方法,氯气" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch_desc.php" title="(中文(简体))" />
<link title="Creative Commons" type="application/rdf+xml" href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&action=creativecommons" rel="meta" />
<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html" />
<title>一氧化碳</title>
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/skins/monobook/main.css?42b"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="/skins/common/commonPrint.css?42b" />
<link rel="stylesheet" type="text/css" media="handheld" href="/skins/monobook/handheld.css?42b" />
<!--[if lt IE 5.5000]><style type="text/css">@import "/skins/monobook/IE50Fixes.css?42b";</style><![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "/skins/monobook/IE55Fixes.css?42b";</style><![endif]-->
<!--[if IE 6]><style type="text/css">@import "/skins/monobook/IE60Fixes.css?42b";</style><![endif]-->
<!--[if IE 7]><style type="text/css">@import "/skins/monobook/IE70Fixes.css?42b";</style><![endif]-->
<!--[if lt IE 7]><script type="text/javascript" src="/skins/common/IEFixes.js?42b"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<script type= "text/javascript">/*<![CDATA[*/
var skin = "monobook";
var stylepath = "/skins";
var wgArticlePath = "/index.php/$1";
var wgScriptPath = "";
var wgServer = "http://localhost";
var wgCanonicalNamespace = "";
var wgCanonicalSpecialPageName = false;
var wgNamespaceNumber = 0;
var wgPageName = "一氧化碳";
var wgTitle = "一氧化碳";
var wgArticleId = "6487";
var wgIsArticle = true;
var wgUserName = null;
var wgUserLanguage = "zh-sg";
var wgContentLanguage = "zh-sg";
var wgBreakFrames = false;
var wgCurRevisionId = "6487";
/*]]>*/</script>
<script type="text/javascript" src="/skins/common/wikibits.js?42b"><!-- wikibits js --></script>
<script type="text/javascript" src="/index.php?title=-&action=raw&gen=js"><!-- site js --></script>
<style type="text/css">/*<![CDATA[*/
@import "/index.php?title=Common.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";
@import "/index.php?title=Monobook.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";
@import "/index.php?title=-&action=raw&gen=css&maxage=18000";
/*]]>*/</style>
<!-- Head Scripts -->
</head>
<body class="ns-0 ltr page-一氧化碳">
<div id="globalWrapper">
<div id="column-content">
<div id="content">
<a name="top" id="top"></a>
//**********************************************************************************
<h1 class="firstHeading">一氧化碳</h1>
<div id="bodyContent">
<h3 id="siteSub">取自 AEED</h3>
<div id="contentSub"></div>
<div id="jump-to-nav">跳转到: <a href="#column-one">导航</a>, <a href="#searchInput">搜索</a></div> <!-- start content -->
<a href="/index.php/%E5%B8%B8%E8%A7%81%E5%8D%B1%E9%99%A9%E5%93%81%E5%A4%84%E7%BD%AE%E6%96%B9%E6%B3%95" title="常见危险品处置方法">常见危险品处置方法</a>-><a href="/index.php/%E5%B8%B8%E8%A7%81%E5%8D%B1%E9%99%A9%E5%93%81%E4%B8%AD%E6%AF%92%E6%80%A5%E6%95%91%E5%8F%8A%E5%BA%94%E6%80%A5%E5%A4%84%E7%90%86%E6%8E%AA%E6%96%BD" title="常见危险品中毒急救及应急处理措施">常见危险品中毒急救及应急处理措施</a>-><br /><table width="800" align="center" cellpadding="20">
<tr>
<td height="30" align="left" valign="middle" bgcolor="EFEFEF">现在位置:<a href="/index.php/%E6%B0%AF%E6%B0%94" title="氯气">上一页</a> > <strong>一氧化碳</strong> > <a href="/index.php/%E5%85%89%E6%B0%94" title="光气">下一页</a></td>
</tr>
<tr bgcolor="#FFFFFF"><td align="center"><p class="STYLE1"> </p>
<p class="STYLE1">(四)一氧化碳 </p>
<p class="STYLE1"> </p></td>
</tr>
<tr><td align="left" bgcolor="#FFFFFF">
<table><tr><td>
<p><strong>1、中毒急救措施 </strong><br />
使患者离开污染区,如呼吸停止,则应立即口对鼻人工呼吸,恢复正常后,给患者吸氧或高压氧。昏迷复苏病人,应注意脑水肿的出现,有脑膜刺激症候及早用甘露醇或高能葡萄糖等脱水治疗。<br />
<br />
<strong>2、应急处理措施</strong> <br />
迅速撤离泄漏污染区人员至上风处,并立即隔离150m,严格限制出入。切断火源。建议应急处理人员戴自给正压式呼吸器,穿消防防护服。尽可能切断泄漏源。合理通风,加速扩散。喷雾状水稀释、溶解。构筑围堤或挖坑收容产生的大量废水。如有可能,将漏出气体用排风机送至空旷地方或装设适当喷头烧掉。也可以用管路导至炉中、凹地焚之。漏气容器要妥善处理,修复、检验后再用。 </p>
</td></tr></table>
</td></tr>
</table>
//***********************************************************************************
<!-- Saved in parser cache with key wikidb:pcache:idhash:6487-0!1!0!!zh-sg!2 and timestamp 20120320084732 -->
<div class="printfooter">
取自"<a href="http://localhost/index.php/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">http://localhost/index.php/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3</a>"</div>
<!-- end content -->
<div class="visualClear"></div>
</div>
</div>
</div>
<div id="column-one">
<div id="p-cactions" class="portlet">
<h5>查看</h5>
<div class="pBody">
<ul>
<li id="ca-nstab-main" class="selected"><a href="/index.php/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">条目</a></li>
<li id="ca-talk" class="new"><a href="/index.php?title=Talk:%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&action=edit">讨论</a></li>
<li id="ca-edit"><a href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&action=edit">编辑</a></li>
<li id="ca-history"><a href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&action=history">历史</a></li>
</ul>
</div>
</div>
<div class="portlet" id="p-personal">
<h5>个人工具</h5>
<div class="pBody">
<ul>
<li id="pt-login"><a href="/index.php?title=Special:Userlogin&returnto=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">登录/注册</a></li>
</ul>
</div>
</div>
<div class="portlet" id="p-logo">
<a style="background-image: url(C:/PHPnow/htdocs/images/logo.png);" href="/index.php/%E9%A6%96%E9%A1%B5" title="首页"></a>
</div>
<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
<div class='portlet' id='p-.E7.9F.A5.E8.AF.86.E5.BA.93'>
<h5>知识库</h5>
<div class='pBody'>
<ul>
<li id="n-.E7.9F.A5.E8.AF.86.E5.BA.93"><a href="/index.php/%E7%9F%A5%E8%AF%86%E5%BA%93">知识库</a></li>
<li id="n-.E5.8D.B1.E9.99.A9.E5.93.81.E7.9F.A5.E8.AF.86.E5.BA.93"><a href="/index.php/%E5%8D%B1%E9%99%A9%E5%93%81%E7%9F%A5%E8%AF%86%E5%BA%93">危险品知识库</a></li>
<li id="n-.E5.B8.B8.E8.A7.81.E5.8D.B1.E9.99.A9.E5.93.81.E5.A4.84.E7.BD.AE.E6.96.B9.E6.B3.95"><a href="/index.php/%E5%B8%B8%E8%A7%81%E5%8D%B1%E9%99%A9%E5%93%81%E5%A4%84%E7%BD%AE%E6%96%B9%E6%B3%95">常见危险品处置方法</a></li>
<li id="n-.E7.8E.AF.E5.A2.83.E6.A0.87.E5.87.86.E5.BA.93"><a href="/index.php/%E7%8E%AF%E5%A2%83%E6%A0%87%E5%87%86%E5%BA%93">环境标准库</a></li>
<li id="n-.E7.8E.AF.E5.A2.83.E6.B3.95.E5.BE.8B.E6.B3.95.E8.A7.84.E5.BA.93"><a href="/index.php/%E6%B3%95%E5%BE%8B%E6%B3%95%E8%A7%84">环境法律法规库</a></li>
</ul>
</div>
</div>
<div id="p-search" class="portlet">
<h5><label for="searchInput">搜索</label></h5>
<div id="searchBody" class="pBody">
<form action="/index.php/Special:Search" id="searchform"><div>
<input id="searchInput" name="search" type="text" accesskey="f" value="" />
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="进入" />
<input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="搜索" />
</div></form>
</div>
</div>
<div class="portlet" id="p-tb">
<h5>工具箱</h5>
<div class="pBody">
<ul>
<li id="t-whatlinkshere"><a href="/index.php/Special:Whatlinkshere/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">链入页面</a></li>
<li id="t-recentchangeslinked"><a href="/index.php/Special:Recentchangeslinked/%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3">链出更改</a></li>
<li id="t-upload"><a href="/index.php/Special:Upload">上传文件</a></li>
<li id="t-specialpages"><a href="/index.php/Special:Specialpages">特殊页面</a></li>
<li id="t-print"><a href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&printable=yes">可打印版</a></li> <li id="t-permalink"><a href="/index.php?title=%E4%B8%80%E6%B0%A7%E5%8C%96%E7%A2%B3&oldid=6487">永久链接</a></li> </ul>
</div>
</div>
</div><!-- end of the left (by default at least) column -->
<div class="visualClear"></div>
<div id="footer">
<div id="f-poweredbyico"><a href="http://www.mediawiki.org/"><img src="/skins/common/images/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" /></a></div>
<div id="f-copyrightico"><a href="http://www.gnu.org/copyleft/fdl.html"><img src="/skins/common/images/gnu-fdl.png" alt='GNU Free Documentation License 1.2' /></a></div>
<ul id="f-list">
<li id="lastmod"> 本页面最后修订:2012年1月25日,09:12.</li>
</ul>
</div>
<script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script>
</div>
<!-- Served by localhost in 0.253 secs. --></body></html>
需要抓取的部分我已经标识出来了,谢谢帮忙了
print_r($match);