獲取網頁指定內容,終於不用正則表示式.
阿新 • • 發佈:2018-11-07
剛設計一個獲取網頁內中草藥資料提取的軟體,原想找些正則表示式來達到獲取文字資料,試找了些,都是獲取連結和連結文字的,還有獲取TD間文字的沒試過,不過對照獲取到的網頁內容可見效果不很滿意,於是自己對網頁內容進行分析,經過2天的努力,終於不用正則表示式,獲取到想要的純文字資料,下面是使用語句獲取的一個網頁內容:
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=GB2312"> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> <title>玄蔘 - 中藥查詢</title> <meta name="Keywords" content="玄蔘,玄蔘的功效與作用"> <meta name="Description" content="玄蔘,多年生草本,根肥大,圓柱形,下部常分枝,外皮灰褐色。喜生於溼潤土壤中。於10~11月挖取根部,晒乾。玄蔘的功效與作用:涼血滋陰、瀉火解毒。 "> <link href="/img/css/39base.css" rel="stylesheet" type="text/css"> <link href="/img/css/jbk_nav12_2.css" rel="stylesheet" type="text/css"> <link href="/img/css/jbk_style.css" rel="stylesheet" type="text/css"> <link rel="stylesheet" type="text/css" href="/img/css/jbk201210.css" media="all"> <link href="/img/css/index_style201012.css" rel="stylesheet" type="text/css"> <script src="/img/js/jquery-1.js" type="text/javascript"></script> <script type="text/javascript" language="javascript" src="/img/js/common.js"></script> <script type="text/javascript" language="javascript" src="/img/js/jquery-1.js"></script> <script language="javascript" type="text/javascript" src="http://www.zhongyoo.com/img/js/toptongji.js"></script> <link href="/img/css/on_new.css" type="text/css" rel="stylesheet"> </head> <body> <div class="new_nav"> <div class="new_navtext"> <div class="text"><a href="http://www.zhongyoo.com/">中藥首頁</a><a href="http://www.zhongyoo.com/name/">中藥大全</a><a href="http://www.zhongyoo.com/fangji/">中藥方劑</a><a href="http://www.zhongyoo.com/pianfang/">偏方祕方</a><a href="http://www.zhongyoo.com/tupian/">中藥圖片</a><a href="http://www.zhongyoo.com/yangsheng/">中藥養生</a><a href="http://www.zhongyoo.com/jianding/">中藥鑑定</a><a href="http://www.zhongyoo.com/shuji/">中藥名著</a><a href="http://www.zhongyoo.com/zhongchengyao/">中成藥</a><a href="http://www.zhongyoo.com/paozhi/">中藥炮製</a><a href="http://www.zhongyoo.com/chuanshuo/">傳說故事</a><a href="http://www.zhongyoo.com/xw/">鍼灸穴點陣圖</a><a href="http://www.zhongyoo.com/meirong/">中藥美容</a><a href="http://www.zhongyoo.com/zhongzhi/">中藥種植</a><a href="http://www.zhongyoo.com/wenda/">中醫藥問答</a><a href="http://www.zhongyoo.com/yaojiu/">藥酒大全</a></div> </div> </div> <div class="new_zt_navi"><a href="http://www.zhongyoo.com/name/zisuzi_2060.html" title="紫蘇子">紫蘇子</a>| <a href="http://www.zhongyoo.com/name/jiayanxi_73.html" title="假芫茜">假芫茜</a>| <a href="http://www.zhongyoo.com/name/lingxiangcao_239.html" title="靈香草">靈香草</a>| <a href="http://www.zhongyoo.com/name/tianzhuhuang_135.html" title="天竺黃">天竺黃</a>| <a href="http://www.zhongyoo.com/name/ricaogen_625.html" title="日草根">日草根</a>| <a href="http://www.zhongyoo.com/name/jixueteng_75.html" title="雞血藤">雞血藤</a>| <a href="http://www.zhongyoo.com/name/kuandonghua_641.html" title="款冬花">款冬花</a>| <a href="http://www.zhongyoo.com/name/ganjiang_230.html" title="乾薑">乾薑</a>| <a href="http://www.zhongyoo.com/name/xianhecao_658.html" title="仙鶴草">仙鶴草</a>| <a href="http://www.zhongyoo.com/name/huangjingzi_1303.html" title="黃荊子">黃荊子</a>| <a href="http://www.zhongyoo.com/name/shanzhuyu_1792.html" title="山茱萸">山茱萸</a>| <a href="http://www.zhongyoo.com/name/baishouwu_3273.html" title="白首烏">白首烏</a>| <a href="http://www.zhongyoo.com/name/dafupi_1775.html" title="大腹皮">大腹皮</a>| <a href="http://www.zhongyoo.com/name/dazao_677.html" title="大棗">大棗</a>| <a href="http://www.zhongyoo.com/name/yemazhui_2045.html" title="野馬追">野馬追</a>| <a href="http://www.zhongyoo.com/name/jizhaodahuang_708.html" title="雞爪大黃">雞爪大黃</a>| <a href="http://www.zhongyoo.com/name/tubeimu_729.html" title="土貝母">土貝母</a>| <a href="http://www.zhongyoo.com/name/yiyiren_1053.html" title="薏苡仁">薏苡仁</a>| <a href="http://www.zhongyoo.com/name/duyiwei_2020.html" title="獨一味">獨一味</a>| <a href="/name/rencan_797.html" title="人蔘">人蔘</a></div> <div class="wrap1"> <div class="wrap"> <script>show_view_01();</script> </div> </div> <script src="/img/js/top_common.js" type="text/javascript"></script> <div class="wrap1"> <div class="cnnav"> <div class="cnmain"> <div class="cnlogo"><a title="中藥查詢" href="http://www.zhongyoo.com/">中藥查詢</a></div> <div class="cnmid"><span class="le"></span> <div class="cnbody2"><span><a href="http://www.zhongyoo.com/name/" title="找中藥">找中藥</a></span>|<span><a href="http://www.zhongyoo.com/fangji/" title="找方劑">找方劑</a></span></div> <span class="midimg2"></span> <div class="cnbody1"><span><a href="http://www.zhongyoo.com/pianfang/" title="找偏方">找偏方</a></span>|<span><a href="http://www.zhongyoo.com/tupian/" title="找圖譜">找圖譜</a></span>|<span><a href="http://www.zhongyoo.com/jianding/" title="中藥鑑定">中藥鑑定</a></span>|<span><a href="http://www.zhongyoo.com/yangsheng/" title="中藥養生">中藥養生</a></span></div> <span class="midimg1"></span> <div class="cnbody2"><span><a href="http://www.zhongyoo.com/zhongchengyao/" title="中成藥">中成藥</a></span>|<span><a href="http://www.zhongyoo.com/xw/" title="鍼灸穴位">鍼灸穴位</a></span>|<span><a href="http://www.zhongyoo.com/paozhi/" title="中藥炮製">中藥炮製</a></span></div> <span class="midimg2"></span> <div class="cnbody1"><span><a href="http://www.zhongyoo.com/zhongzhi/" title="中藥種植">中藥種植</a></span>|<span><a href="http://www.zhongyoo.com/meirong/" title="中藥美容">中藥美容</a></span></div> </div> <div class="cnr"></div> <div class="cnmore"><a onmouseover="showList('cnshowMore',1);" onmouseout="showList('cnshowMore',0);">更多</a></div> <div id="cnshowMore" onmouseover="showList('cnshowMore',1);" onmouseout="showList('cnshowMore',0);" style="display: none;"> <div class="cnmore2"><a>更多</a>></div> <ul> <li><a href="http://www.zhongyoo.com/chuanshuo/" title="中藥傳說">中藥傳說</a></li> <li><a href="http://www.zhongyoo.com/yaojiu/" title="藥酒大全">藥酒大全</a></li> <li><a href="http://www.zhongyoo.com/pianfang/yangwei/" title="陽痿偏方">陽痿偏方</a></li> <li><a href="http://www.zhongyoo.com/shuji/" title="中藥名著">中藥名著</a></li> </ul> </div> <div class="search_cn"><span>熱門分類</span><u><a href="http://www.zhongyoo.com/gx/">按功效查詢</a></u><u><a href="http://www.zhongyoo.com/guijing/">按歸經查詢</a></u><u><a href="http://www.zhongyoo.com/pinyin/">按拼音查詢</a></u><span class="s">其他分類</span><cite><strong><a href="http://www.zhongyoo.com/yx/">按藥性分類</a></strong> <strong><a href="http://www.zhongyoo.com/yw/">按藥味分類</a></strong> <strong><a href="http://www.zhongyoo.com/bw/">按藥用部位分類</a></strong> </cite></div> <div class="sear"></div> </div> <div class="cnsearch"> <div class="searchInfo"><span class="f12">共收錄中藥<i class="c_f60">895</i>條</span> <form name="formsearch" action="http://www.zhongyoo.com/sousuo/" method="get" target="_blank" onsubmit="if(this.value=='輸入您要查詢的中藥名稱'){this.value='輸入您要查詢的中藥名稱';words.focus(輸入您要查詢的中藥名稱);}" name="search"> <div class="searchBut"> <div class="option" onclick="wValDisp('h','showlist');"><span id="wn_h">中藥</span></div> <div class="sbox"> <input defcol="rgb(187, 187, 187)" defval="" name="q" id="Text1" maxlength="43" type="text"> </div> <input value="搜尋" class="sbtn" type="submit"> </div> <em></em> </form> </div> <span class="bot"><span class="l"></span><span class="r"></span></span></div> </div> </div> <div class="zoom1"> <div class="lmtree"> <span class="tree"><strong>當前位置:</strong> <a href='http://www.zhongyoo.com/'>主頁</a> > <a href='http://www.zhongyoo.com/name/'>中藥名稱大全</a> > <a href="http://www.zhongyoo.com/name/xuancan_801.html">玄蔘</a></span><span class="spg"> <input id="txtUrl" value="self.location" type="hidden"> <a href="javascript:void(0);" onclick="window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));return false;" title="分享到QQ空間" target="_self" class="set2">分享到QQ空間</a><a href="javascript:void(0);" onclick="window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?to=pengyou&url='+encodeURIComponent(document.location.href));return false;" title="分享到朋友社群" target="_self" class="set2">分享到QQ朋友網</a><a hidefocus="true" href="javascript:myhomepage()" name="homepage" target="_self" class="set1">設為首頁</a><a href="javascript:addfavorite()" target="_self" rel="nofollow" class="set2">加入收藏</a></span> </div> </div> <div class="wrap1"> <div class="con_left2"> <div class="gaishu"> <div class="title"> <h1>玄蔘</h1> </div> <center> <script>show_view_05();</script> </center> <div class="text"> <p></p> <p> <img align="right" alt="玄蔘藥材" border="3" src="/uploads/allimg/130725/1-130H5141H0D2.jpg" style="width: 250px; height: 200px;" /> 【<strong>中藥名</strong>】<u><a href='http://www.zhongyoo.com/name/xuancan_801.html' target='_blank'>玄蔘</a></u> xuanshen</p> <p> 【<strong>別名</strong>】元參、北玄蔘、黑參、山<u><a href='http://www.zhongyoo.com/name/danggui_142.html' target='_blank'>當歸</a></u>。</p> <p> 【<strong>英文名</strong>】Scrophulariae Radix。</p> <p> 【<strong>來源</strong>】玄蔘科植物北玄蔘Scrophularia buergeriana Miq. (S. oldhamiOliv.)的根。</p> <p> 【<strong>植物形態</strong>】多年生草本,高60~120釐米。根肥大,圓柱形,下部常分枝,外皮灰褐色。莖直立,四稜形,有溝紋。下部的葉對生,上部的葉有時互生,均具柄,葉片卵形至長卵形,長5~12釐米,寬3.5~12釐米,先端尖,基部圓形或近截形,邊緣具細鋸齒。聚傘花序總花序緊縮成穗狀,花序軸及花梗均被腺毛,花萼長2~3毫米,5裂幾達基部,裂片近圓形,邊緣膜質,花冠黃綠色,管部斜壺狀,能育雄蕊4枚,退化雄蕊1枚,近圓形,貼生在花冠管上,子房上位,2室。蒴果卵形,長約6毫米。</p> <p> 【<strong>產地分佈</strong>】喜生於溼潤土壤中。分佈於黑龍江、吉林、遼寧、河北、內蒙古等地。</p> <p> 【<strong>採收加工</strong>】於10~11月挖取根部,除去莖葉及泥土,剝脫子芽供留種栽培用,根部晒至半乾且內部色變黑時,剪去蘆頭及鬚根,堆放3~4天(發汗)後,晒乾或烘乾。</p> <p> 【<strong>藥材性狀</strong>】圓柱形,中部略粗或上粗下細,有的微彎似羊角,長6~20釐米,寬1~3釐米。表面灰褐色,有縱皺紋,有細根及細根痕。質堅實,難折斷,斷面略平坦,色黑,微有光澤。有焦糖氣,味甘、微苦,以水浸泡,水呈黑色。以條粗壯、質堅實、斷面色黑者為佳。</p> <p> 【<strong>性味歸經</strong>】性微寒,味甘、苦、鹹。歸<u><a href='http://www.zhongyoo.com/guijing/feijing/' target='_blank'>肺經</a></u>、<u><a href='http://www.zhongyoo.com/guijing/weijing/' target='_blank'>胃經</a></u>、<u><a href='http://www.zhongyoo.com/guijing/shenjing/' target='_blank'>腎經</a></u>。</p> <p> 【<strong>功效與作用</strong>】涼血滋陰、瀉火解毒。屬清熱藥下分類的清熱涼血藥。</p> <p> 【<strong>臨床應用</strong>】用量9~15克,內服煎湯,或入丸散,治療熱病傷陰、舌降煩渴、溫毒發斑、津傷便祕、骨蒸勞嗽、目赤、咽痛、瘰癧、白喉、癰腫瘡毒、高血壓。外用搗敷或研末調敷。治咽喉連舌腫痛:玄蔘、射干、黃藥各15克,水煎服。</p> <p> 【<strong>藥理研究</strong>】北玄蔘水浸、醇浸液灌服或注射給正常(貓、犬、兔)及腎型高血壓犬均有降壓作用,醇浸膏還能抗缺氧、抗心肌缺血、增加心肌營血量;水浸液對離體豚鼠支氣管有明顯的舒張作用,並能加強腎上腺素的作用。毒性:小鼠腹腔注射水煎劑的LD50為15.99~19.91克/千克。另具有解熱、抗菌、保護心肌缺血、解痙、降血壓、降血糖等作用。</p> <p> 【<strong>主要成分</strong>】根中含哈巴苷(70%~80%)、8-鄰甲基對香豆醯、哈巴苷,均系變黑的物質。另含哈巴俄苷、玄蔘三酯苷、玄蔘種苷、桃葉珊瑚苷、玄蔘環醚、京尼平苷、賽斯坦苷F、去咖啡醯毛蕊花糖苷、毛蕊花苷等。</p> <p> 【<strong>使用禁忌</strong>】脾虛便溏或脾胃有溼者禁服。不宜與<u><a href='http://www.zhongyoo.com/name/lilu_798.html' target='_blank'>藜蘆</a></u>同用。</p> <p> 【<strong>相關藥方</strong>】①治口舌生瘡,久不愈:玄蔘、天門冬(去心、焙)、麥門冬(去心、焙)各30克。搗羅為末,煉蜜和丸,如彈子大。每以綿裹一丸,含化咽津。(《聖濟總錄》玄蔘丸)</p> <p> ②治鼻中生瘡:用玄蔘,水漬軟,塞鼻中,或為末滌之。(《衛生易簡方》)</p> <p> ③治夜臥口渴喉幹:玄蔘二片含口中,即生津液。(《吉人集驗方》)</p> <p> ④治氣虛血壅,小便赤濁,似血非血,似溺非溺,溺管疼痛:玄蔘、<u><a href='http://www.zhongyoo.com/name/cheqianzi_890.html' target='_blank'>車前子</a></u>各30克,水煎服。(《辨證錄》玄車丹)</p> <p> ⑤治因陰陽偏,火有餘而水不足,遇事或多言則心煩,常感胸中擾壤,紛紜而嘈雜:玄蔘、<u><a href='http://www.zhongyoo.com/name/maidong_865.html' target='_blank'>麥冬</a></u>各60克,水煎服。(《辨證錄》玄冬湯)</p> <p></p> </br > <center> <script>show_view_04();</script> </center> </br > <div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a title="分享到QQ空間" href="#" class="bds_qzone" data-cmd="qzone"></a><a title="分享到百度貼吧" href="#" class="bds_tieba" data-cmd="tieba"></a><a title="分享到新浪微博" href="#" class="bds_tsina" data-cmd="tsina"></a><a title="分享到微信" href="#" class="bds_weixin" data-cmd="weixin"></a><a title="分享到QQ好友" href="#" class="bds_sqq" data-cmd="sqq"></a><a title="分享到豆瓣網" href="#" class="bds_douban" data-cmd="douban"></a></div> <span>最近更新時間:2016-04-19</span> </div> </div> <div id="special1" style="display:none;"></div> <div class="gg_750"> <script>show_view_03();</script> </div> <div class="box3"> <div class="title3"> <h3><font>中藥</font>常見偏方</h3> <span><a href="http://www.zhongyoo.com/pianfang/">更多相關文章 >></a></span> </div> <div class="body3"> <div class="hot1"> <div class="con"> <ul> <li><span><a href="http://www.zhongyoo.com/pianfang/1290.html">石菖蒲遠志治中風</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1627.html">桂枝乳香治子宮肌瘤</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1318.html">天麻鉤藤治三叉神經痛</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1356.html">硼砂丁香散治下肢潰瘍</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1104.html">金錢草柴胡治慢性膽囊炎</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1409.html">消痔四黃膏治痔瘡</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1928.html">山藥雞肝治嬰幼兒慢性腹瀉</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1767.html">海螵蛸生龍骨治陽痿</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1907.html">穿山甲肉桂治前列腺增生症</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1463.html">赤芍治急性闌尾炎</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/1189.html">肺癰草地盤茶治肺結核</a></span> </li> <li><span><a href="http://www.zhongyoo.com/pianfang/2051.html">黃連麻黃治百日咳</a></span> </li> </ul> </div> </div> </div> </div> <div class="box3"> <div class="title3"> <h3><font>中藥</font>常用方劑</h3> <span><a href="http://www.zhongyoo.com/fangji/">更多相關文章 >></a></span> </div> <div class="body3"> <div class="hot1"> <div class="con"> <ul> <li><span><a href="http://www.zhongyoo.com/fangji/bhw_1422.html">保和丸</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/bht_1007.html">白虎湯</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/lys_1208.html">六一散</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/mls_1330.html">牡蠣散</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/yjw_534.html">越鞠丸</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/zss_539.html">止嗽散</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/lgs_1076.html">涼膈散</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/ypfs_546.html">玉屏風散</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/dcht_1196.html">大柴胡湯</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/dcqt_1064.html">大承氣湯</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/ldxgt_1281.html">龍膽瀉肝湯</a></span> </li> <li><span><a href="http://www.zhongyoo.com/fangji/twbxd_563.html">天王補心丹</a></span> </li> </ul> </div> </div> </div> </div> </div> <div class="con_right"> <div class="aside"> <script>show_view_07();</script> <div class="box5_c box8_c marT10"> <span class="title2_c"><i class="L"></i><i class="R"></i><strong>中藥圖譜</strong></span> <span class="box_c"> <ul class="imglist"> <li><a href='http://www.zhongyoo.com/name/kudidan_80.html' class='title'><img src='http://www.zhongyoo.com/uploads/allimg/131203/1-131203094GME-lp.jpg' alt='苦地膽' /></a><span><a href="http://www.zhongyoo.com/name/kudidan_80.html" title="苦地膽" class="title">苦地膽</a></span></li> <li><a href='http://www.zhongyoo.com/name/zhudanfen_1863.html' class='title'><img src='http://www.zhongyoo.com/uploads/allimg/140731/1-140I1102359540-lp.jpg' alt='豬膽粉' /></a><span><a href="http://www.zhongyoo.com/name/zhudanfen_1863.html" title="豬膽粉" class="title">豬膽粉</a></span></li> <li><a href='http://www.zhongyoo.com/name/danyemanjingzi_734.html' class='title'><img src='http://www.zhongyoo.com/uploads/allimg/131118/1-13111P94F3S0-lp.jpg' alt='單葉蔓荊子' /></a><span><a href="http://www.zhongyoo.com/name/danyemanjingzi_734.html" title="單葉蔓荊子" class="title">單葉蔓荊子</a></span></li> <li><a href='http://www.zhongyoo.com/name/luganshi_2138.html' class='title'><img src='http://www.zhongyoo.com/uploads/allimg/141218/1-14121Q53000J0-lp.jpg' alt='爐甘石' /></a><span><a href="http://www.zhongyoo.com/name/luganshi_2138.html" title="爐甘石" class="title">爐甘石</a></span></li> <li><a href='http://www.zhongyoo.com/name/xihuangcao_133.html' class='title'><img src='http://www.zhongyoo.com/uploads/allimg/131225/1-131225110021613-lp.jpg' alt='溪黃草' /></a><span><a href="http://www.zhongyoo.com/name/xihuangcao_133.html" title="溪黃草" class="title">溪黃草</a></span></li> <li><a href='http://www.zhongyoo.com/name/mahuanggen_2055.html' class='title'><img src='http://www.zhongyoo.com/uploads/allimg/141009/1-14100Z9492J42-lp.jpg' alt='麻黃根' /></a><span><a href="http://www.zhongyoo.com/name/mahuanggen_2055.html" title="麻黃根" class="title">麻黃根</a></span></li> </ul> </span> </div> <div class="box5_c box8_c marT10"> <script>show_view_06();</script> </div> <div class="gbox210" id="db_baidu1"> <div class="box5_c box8_c"> <span class="title2_c"> <i class="L"></i><i class="R"></i><strong>熱門中藥</strong> </span> <span class="box_c"> <ul class="list1_c"> <li><a href='http://www.zhongyoo.com/name/pibaye_18.html' title="枇杷葉">枇杷葉</a></li> <li><a href='http://www.zhongyoo.com/name/huangjingzi_1303.html' title="黃荊子">黃荊子</a></li> <li><a href='http://www.zhongyoo.com/name/dinggongteng_40.html' title="丁公藤">丁公藤</a></li> <li><a href='http://www.zhongyoo.com/name/tiebaojin_136.html' title="鐵包金">鐵包金</a></li> <li><a href='http://www.zhongyoo.com/name/zoumatai_179.html' title="走馬胎">走馬胎</a></li> <li><a href='http://www.zhongyoo.com/name/luohanguo_204.html' title="羅漢果">羅漢果</a></li> <li><a href='http://www.zhongyoo.com/name/yemianhua_244.html' title="野棉花">野棉花</a></li> <li><a href='http://www.zhongyoo.com/name/boluohui_533.html' title="博落回">博落回</a></li> <li><a href='http://www.zhongyoo.com/name/yanwo_1739.html' title="燕窩">燕窩</a></li> <li><a href='http://www.zhongyoo.com/name/ciweipi_1883.html' title="刺蝟皮">刺蝟皮</a></li> </ul> <ul class="list1_c"> <li><a href='http://www.zhongyoo.com/name/jigucao_77.html' title="雞骨草">雞骨草</a></li> <li><a href='http://www.zhongyoo.com/name/tianxianzi_860.html' title="天仙子">天仙子</a></li> <li><a href='http://www.zhongyoo.com/name/shancha_829.html' title="山楂">山楂</a></li> <li><a href='http://www.zhongyoo.com/name/danzhuye_726.html' title="淡竹葉">淡竹葉</a></li> <li><a href='http://www.zhongyoo.com/name/jianhua_74.html' title="劍花">劍花</a></li> <li><a href='http://www.zhongyoo.com/name/jiuxiangchong_1252.html' title="九香蟲">九香蟲</a></li> <li><a href='http://www.zhongyoo.com/name/jili_670.html' title="蒺藜">蒺藜</a></li> <li><a href='http://www.zhongyoo.com/name/duhuo_181.html' title="獨活">獨活</a></li> <li><a href='http://www.zhongyoo.com/name/qianjinzi_805.html' title="千金子">千金子</a></li> <li><a href='http://www.zhongyoo.com/name/bajitian_1901.html' title="巴戟天">巴戟天</a></li> </ul> </span> </div> </div> </div> <div class="clearer"></div> </div> <div class="copyrightbox"> <div> <span> 本站所有內容均是來源於網際網路、正規藥學專著、雜誌及文摘,內容如果有錯誤之處,也懇請批評指正。您如果轉載本站內容請註明來源地址。</span> </div> <script>show_view_02();</script> </div> <div class="bottominfo" id="bottominfo" style="padding-top:10px;"> <hr style="width:970px;color:#bbb;" size="1"> <a href="http://www.zhongyoo.com/" title="中藥">中藥</a> | <a href="http://www.zhongyoo.com/sitemap.html" rel="nofollow">網站地圖</a> | <a href="http://www.zhongyoo.com/name/" title="中藥材名稱大全">中藥材名稱大全</a> | <a href="javascript:myhomepage()" name="homepage" target="_self" rel="nofollow">設為首頁</a> | <a href="javascript:addfavorite()" target="_self" rel="nofollow">加入收藏</a><br> Copyright © 2016 www.zhongyoo.com All Rights Reserved. 中藥查詢 京ICP備13004469號-1 <script language="javascript" type="text/javascript" src="http://www.zhongyoo.com/img/js/tongji.js"></script></div> <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script> <script type="text/javascript" id='speedup_test' src="https://idm-su.baidu.com/su.js"></script> </body> </html>
我想要的內容是從【<strong>中藥名</strong>】到【<strong>相關藥方</strong>】這些內容,而這些內容中還包含了不想要的字元,首先我想到的是如何刪除<>之間的內容,於是寫了一個處理函式:
string 刪除單字元區間(string 資料, string 分隔符) { int 尋 = 0, 找 = 0; while (true) { 尋 = 資料.IndexOf(分隔符[0]); 找 = 資料.IndexOf(分隔符[1]); if (尋 < 0) break; if (尋 > 找) 資料 = 資料.Remove(找, 1); else 資料 = 資料.Remove(尋, (找 - 尋) + 1); } return 資料; }
得到了如下處理的內容:
玄蔘 - 中藥查詢 中藥首頁中藥大全中藥方劑偏方祕方中藥圖片中藥養生中藥鑑定中藥名著中成藥中藥炮製傳說故事鍼灸穴點陣圖中藥美容中藥種植中醫藥問答藥酒大全 紫蘇子| 假芫茜| 靈香草| 天竺黃| 日草根| 雞血藤| 款冬花| 乾薑| 仙鶴草| 黃荊子| 山茱萸| 白首烏| 大腹皮| 大棗| 野馬追| 雞爪大黃| 土貝母| 薏苡仁| 獨一味| 人蔘 show_view_01(); 中藥查詢 找中藥|找方劑 找偏方|找圖譜|中藥鑑定|中藥養生 中成藥|鍼灸穴位|中藥炮製 中藥種植|中藥美容 更多 更多 中藥傳說 藥酒大全 陽痿偏方 中藥名著 熱門分類按功效查詢按歸經查詢按拼音查詢其他分類按藥性分類 按藥味分類 按藥用部位分類 共收錄中藥895條 中藥 當前位置: 主頁 中藥名稱大全 玄蔘 分享到QQ空間分享到QQ朋友網設為首頁加入收藏 玄蔘 show_view_05(); 【中藥名】玄蔘 xuanshen 【別名】元參、北玄蔘、黑參、山當歸。 【英文名】Scrophulariae Radix。 【來源】玄蔘科植物北玄蔘Scrophularia buergeriana Miq. (S. oldhamiOliv.)的根。 【植物形態】多年生草本,高60~120釐米。根肥大,圓柱形,下部常分枝,外皮灰褐色。莖直立,四稜形,有溝紋。下部的葉對生,上部的葉有時互生,均具柄,葉片卵形至長卵形,長5~12釐米,寬3.5~12釐米,先端尖,基部圓形或近截形,邊緣具細鋸齒。聚傘花序總花序緊縮成穗狀,花序軸及花梗均被腺毛,花萼長2~3毫米,5裂幾達基部,裂片近圓形,邊緣膜質,花冠黃綠色,管部斜壺狀,能育雄蕊4枚,退化雄蕊1枚,近圓形,貼生在花冠管上,子房上位,2室。蒴果卵形,長約6毫米。 【產地分佈】喜生於溼潤土壤中。分佈於黑龍江、吉林、遼寧、河北、內蒙古等地。 【採收加工】於10~11月挖取根部,除去莖葉及泥土,剝脫子芽供留種栽培用,根部晒至半乾且內部色變黑時,剪去蘆頭及鬚根,堆放3~4天(發汗)後,晒乾或烘乾。 【藥材性狀】圓柱形,中部略粗或上粗下細,有的微彎似羊角,長6~20釐米,寬1~3釐米。表面灰褐色,有縱皺紋,有細根及細根痕。質堅實,難折斷,斷面略平坦,色黑,微有光澤。有焦糖氣,味甘、微苦,以水浸泡,水呈黑色。以條粗壯、質堅實、斷面色黑者為佳。 【性味歸經】性微寒,味甘、苦、鹹。歸肺經、胃經、腎經。 【功效與作用】涼血滋陰、瀉火解毒。屬清熱藥下分類的清熱涼血藥。 【臨床應用】用量9~15克,內服煎湯,或入丸散,治療熱病傷陰、舌降煩渴、溫毒發斑、津傷便祕、骨蒸勞嗽、目赤、咽痛、瘰癧、白喉、癰腫瘡毒、高血壓。外用搗敷或研末調敷。治咽喉連舌腫痛:玄蔘、射干、黃藥各15克,水煎服。 【藥理研究】北玄蔘水浸、醇浸液灌服或注射給正常(貓、犬、兔)及腎型高血壓犬均有降壓作用,醇浸膏還能抗缺氧、抗心肌缺血、增加心肌營血量;水浸液對離體豚鼠支氣管有明顯的舒張作用,並能加強腎上腺素的作用。毒性:小鼠腹腔注射水煎劑的LD50為15.99~19.91克/千克。另具有解熱、抗菌、保護心肌缺血、解痙、降血壓、降血糖等作用。 【主要成分】根中含哈巴苷(70%~80%)、8-鄰甲基對香豆醯、哈巴苷,均系變黑的物質。另含哈巴俄苷、玄蔘三酯苷、玄蔘種苷、桃葉珊瑚苷、玄蔘環醚、京尼平苷、賽斯坦苷F、去咖啡醯毛蕊花糖苷、毛蕊花苷等。 【使用禁忌】脾虛便溏或脾胃有溼者禁服。不宜與藜蘆同用。 【相關藥方】①治口舌生瘡,久不愈:玄蔘、天門冬(去心、焙)、麥門冬(去心、焙)各30克。搗羅為末,煉蜜和丸,如彈子大。每以綿裹一丸,含化咽津。(《聖濟總錄》玄蔘丸) ②治鼻中生瘡:用玄蔘,水漬軟,塞鼻中,或為末滌之。(《衛生易簡方》) ③治夜臥口渴喉幹:玄蔘二片含口中,即生津液。(《吉人集驗方》) ④治氣虛血壅,小便赤濁,似血非血,似溺非溺,溺管疼痛:玄蔘、車前子各30克,水煎服。(《辨證錄》玄車丹) ⑤治因陰陽偏,火有餘而水不足,遇事或多言則心煩,常感胸中擾壤,紛紜而嘈雜:玄蔘、麥冬各60克,水煎服。(《辨證錄》玄冬湯) show_view_04(); 最近更新時間:2016-04-19 show_view_03(); 中藥常見偏方 更多相關文章 石菖蒲遠志治中風 桂枝乳香治子宮肌瘤 天麻鉤藤治三叉神經痛 硼砂丁香散治下肢潰瘍 金錢草柴胡治慢性膽囊炎 消痔四黃膏治痔瘡 山藥雞肝治嬰幼兒慢性腹瀉 海螵蛸生龍骨治陽痿 穿山甲肉桂治前列腺增生症 赤芍治急性闌尾炎 肺癰草地盤茶治肺結核 黃連麻黃治百日咳 中藥常用方劑 更多相關文章 保和丸 白虎湯 六一散 牡蠣散 越鞠丸 止嗽散 涼膈散 玉屏風散 大柴胡湯 大承氣湯 龍膽瀉肝湯 天王補心丹 show_view_07(); 中藥圖譜 苦地膽 豬膽粉 單葉蔓荊子 爐甘石 溪黃草 麻黃根 show_view_06(); 熱門中藥 枇杷葉 黃荊子 丁公藤 鐵包金 走馬胎 羅漢果 野棉花 博落回 燕窩 刺蝟皮 雞骨草 天仙子 山楂 淡竹葉 劍花 九香蟲 蒺藜 獨活 千金子 巴戟天 本站所有內容均是來源於網際網路、正規藥學專著、雜誌及文摘,內容如果有錯誤之處,也懇請批評指正。您如果轉載本站內容請註明來源地址。 show_view_02(); 中藥 | 網站地圖 | 中藥材名稱大全 | 設為首頁 | 加入收藏 Copyright © 2016 www.zhongyoo.com All Rights Reserved. 中藥查詢 京ICP備13004469號-1 window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
然而還有一些不想要的內容該如何去除?使用【】作為分隔符獲取陣列是可以做到的,然而在檢視獲得的陣列內容後會發現有些不需要的內容:
由於網頁內容千差萬別,對多餘文字的處理也就不同,如何才能做到完美?經過2天對獲取到的網頁內容進行分析,得到只要獲取<p></p>之間內容就是我需要的,如果能用多字元作為分隔符就可以獲得想要的資料了,為此,修改上面函式為獲取與刪除雙重功能:
string 刪除單字元區間(string 資料, string 分隔符, string[] 獲取多字元區間)
{
int 尋 = 0, 找 = 0;
資料 = string.Join("\r\n", 資料.Split(獲取多字元區間, StringSplitOptions.RemoveEmptyEntries).Skip(1).Reverse().Skip(1).Reverse());
while (true)
{
尋 = 資料.IndexOf(分隔符[0]);
找 = 資料.IndexOf(分隔符[1]);
if (尋 < 0) break;
if (尋 > 找) 資料 = 資料.Remove(找, 1);
else 資料 = 資料.Remove(尋, (找 - 尋) + 1);
}
return 資料;
}
這樣處理後就獲得了我想要的純淨資料了:
如此的完美,興奮之餘,想以最快的速度分享出來。
這樣以後想要獲取網頁內容就方便了,只要找到想要的和不想要的內容,按理來說都是可以任意獲取的了。
string 刪除單字元區間(string 資料, string 分隔符, string[] 獲取多字元區間)
{
int 尋 = 0, 找 = 0;
資料 = string.Join("\r\n", 資料.Split(獲取多字元區間, StringSplitOptions.RemoveEmptyEntries).Skip(1).Reverse().Skip(1).Reverse());
while (true)
{
尋 = 資料.IndexOf(分隔符[0]);
找 = 資料.IndexOf(分隔符[1]);
if (尋 < 0) break;
資料 = (尋 > 找) ? 資料.Remove(找, 1) : 資料.Remove(尋, (找 - 尋) + 1);
}
return 資料;
}
在這次程式設計中還寫了把字串轉為字串陣列和檢查資料表資料是否存在,存在就不新增資料的功能,稍後分享。
目前軟體介面預覽,下一步要做成爬蟲那樣自動獲取連結集合,自動推斷獲取資料的功能.