易祺專業清潔
為客戶打造最優質的環境
搬家快清辦公桌吧
辦公室細菌量比廁所高400倍!

首頁  •  tw 論壇 • 程式設計討論     • 

爬文程式

房東:蛙蛙
發表時間:2023-03-28
[檢舉]


// 設置要爬取的網址
$url = \'http://example.com/page\';

// 循環獲取所有分頁
for ($i = 1; $i <= 11; $i++) {
// 構造分頁網址
$page_url = $url . \'-\'.$i.\'.html\';

// 使用 cURL 獲取分頁內容
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $page_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$page_content = curl_exec($ch);
curl_close($ch);

// 使用正則表達式或 DOM 解析器提取所需的數據
// 這裡假設您要獲取每個分頁的標題
preg_match(\'/(.*?)<\\/title>/s\', $page_content, $matches);<br /> $title = $matches[1];<br /> <br /> // 顯示結果<br /> echo \"第 {$i} 頁標題:{$title}<br>\";<br /> }<br /> ?><br /> <br></div><tr><td align="right"></td></tr> </td></tr></table><br> <center> <table width="80%" > <tr> </tr> </table> </center> <br><br><center> <TABLE BORDER=1 bordercolor="#97D0FF" bgcolor="#ddf0ff" CELLPADDING=4 width=80%> <TR><TD VALIGN=MIDDLE ALIGN=left width=35%><li>贊助網站        <br><br> <font color=blue><b><a href=http://www.buyhouse.com.tw target=_new> 廣利不動產-新板特區指名度最高、值得您信賴的好房仲 </a></b></font> <br><a href=http://www.buyhouse.com.tw target=_new><font color=#828282> 您的托付,廣利用心為您服務</font></a><br><font color=blue><b><a href=http://www.buyhouse.com.tw target=_new> 廣利不動產-板橋在地生根最實在--新板特區指名度最高、值得您信賴的好房仲 </a></b></font> <br><a href=http://www.buyhouse.com.tw target=_new><font color=#828282> 完整房訊,房屋、店面熱門精選物件,廣利不動產 優質仲介,房屋租賃、買賣資訊透明,交易真安心!</font></a><br></TD></tr></table></center><br> <br><hr size=1> 共 0 人回應 <p> <center><form method=post action=reply_post.php?id=823 onSubmit="return(check())" name="form1"> <script language="javascript"> form1.j2h.value=""; form1.j2h5.value=""; function check() { var str_pattern=/^.{2,34}$/; if(form1.j2h.value.length < 2) { alert("請輸入姓名 !!"); return(false); } if(form1.j2h.value.match(/[12~#$<%^┐*∼§☆°+★~ ̄▽ ̄.≠ˇㄟ@=♂×,.0Oo├﹏☆〃'"\﹋\&*\/\\@!]/)){alert("請正確填寫姓名,請勿使用任何符號或敷衍字\n如果繼續張貼將會被列為黑名單"); return false} var die = ["白痴","白ㄔ","白爛","花癡","喜憨","媽的","哩娘","那ㄇ爛","白目","北七","屌屁","濫遊戲","嘴賤","屌屁","智障","他媽的","廢渣","廢物","機掰","雞掰","靠北","嫩啦","有種來談判","有種出來說","爛片","無三小路用","濫到爆","肉腳","靠邀","殺小","吃屎","阿拉斯加","靠背","電愛","破麻","幹你","幹妳","幹林","幹李","幹幹幹","機掰","幹過了","不給上","給虧嘛","欠人插","啥小","欠幹","屁事","醜到爆","難看死","搞在一起","鬼一樣","長的醜","都很濫","靠你媽","瞎了狗眼","你他媽","死怪物","醜八怪","虎人","智障","嗆聲","幹架","白吃","修幹","去死","敗類","度濫","人渣","插我","雞八","靠杯","啟智","靠逼","狗屌","狗幹","幹砲","吃大便","打奶砲","打手槍","打泡","攬較","嫩逼","人妖","娘砲","下賤","低能兒","好娘","馬ㄉ","弱智","低能","智缺","死一死","攬叫","吃大便","啥鳥","拎北","開始幹她","機八","他媽ㄉ","腦殘","想幹他","別丟臉","爛死了","想嘗試愛愛","幹死妳","想做愛","賤炮","孬種","俗辣","沙小","白木","智帳","臭嘴","孬種","想愛愛","教我","想練","跳舞","不會","地板","不爽","只會","風車","我","妳","他","你","就","請問","這","樣","堆","的","想學","看","不","下","去","了","小蛙","沒","一起","上帝","勃起","j2h","JXH","專砲腦狗","懶趴","笑話","練舞","一個","臭基基","笑死","糙哩","每天","打槍","<"]; for(var i=0;i < die.length;i++) if(form1.j2h.value.toLowerCase().replace(/ /gi, "").indexOf(die[i])!=-1) { alert("名稱中含有疑似不雅或是被禁止使用的名稱或敷衍字,\n請移除此 '"+ die[i] +"' 文字,請正確填寫名稱,\n如果繼續張貼將會被列為黑名單"); return(false);} if(form1.j2h5.value.length < 5) { location="index.php"; return(false); } if(form1.j2h5.value.match(/[ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦ]/)){alert("留言請勿使用任何注音文或是火星文\n如果繼續張貼將會被列為黑名單"); return false} var jstop2 = ["求歌名","什麼歌","音樂叫什麼","歌名"]; for(var i=0;i < jstop2.length;i++) if(form1.j2h5.value.toLowerCase().replace(/ /gi, "").indexOf(jstop2[i])!=-1) { alert("J2H為分享平台,嚴禁張貼求檔求歌名主題\n如果繼續張貼將會被列為黑名單"); location="http://www.j2h.tw/"; return(false); } var jstop = [".exe","yahoo.com","kimo.com","wretch.cc","tinyurl.com","@","<script"]; for(var i=0;i < jstop.length;i++) if(form1.j2h5.value.toLowerCase().replace(/ /gi, "").indexOf(jstop[i])!=-1) { alert("留言內容中含有被禁止張貼的網址,\n請移除此 '"+ jstop[i] +"' 網址,\n如果是要張貼影片請用'連結網址方式',\n請先至新手討論區那邊學習或測試,那有相關教學\n如果繼續張貼將會被列為黑名單"); return(false); } var spam = ["白痴","白癡","白爛","孬種","俗辣","三八","長的醜","白ㄔ","沙小","白木","智帳","北爛","花癡","喜憨","媽的","馬的","哩娘","那ㄇ爛","白目","北七","屌屁","濫遊戲","嘴賤","屌屁","智障","他媽的","廢渣","廢物","機掰","雞掰","靠北","嫩啦","有種來談判","有種出來說","爛片","無三小路用","濫到爆","肉腳","靠邀","殺小","吃屎","阿拉斯加","靠背","電愛","破麻","幹你","幹妳","幹林","幹李","幹幹幹","機掰","幹過了","不給上","給虧嘛","欠人插","啥小","欠幹","屁事","醜到爆","難看死","搞在一起","鬼一樣","長的醜","都很濫","靠你媽","瞎了狗眼","你他媽","死怪物","醜八怪","虎人","智障","嗆聲","幹架","白吃","修幹","去死","敗類","度濫","人渣","插我","雞八","靠杯","啟智","靠逼","狗屌","狗幹","幹砲","吃大便","打奶砲","打手槍","打泡","攬較","嫩逼","人妖","娘砲","下賤","低能兒","好娘","馬ㄉ","弱智","低能","智缺","死一死","攬叫","吃大便","啥鳥","拎北","開始幹她","機八","他媽ㄉ","腦殘","想幹他","別丟臉","爛死了","想嘗試愛愛","幹死妳","靠爸","賤胚","賤炮","臭嘴","屁話","不要臉","白幕","爛人","嫩B","靠腰","砲友","招人","八千下","狼牙","基掰","糙你","<iframe"]; for(var i=0;i < spam.length;i++) if(form1.j2h5.value.toLowerCase().replace(/ /gi, "").indexOf(spam[i])!=-1) { alert("留言內容中含有疑似不雅的文字或是被禁止的文字,\n請移除不雅 '"+ spam[i] +"' 的文字,\n請禮貌已對請勿有任何辱罵批評、挑釁、人身攻擊等字眼,\n以免被列為黑名單"); return(false); } var dirty = ["客源網","寄給我","傳給我","............","____/洗/ ","999999","1樓","location.replace","私服","嘴砲","嘴炮","嘴泡","炮文","嘴巴最強","砲你","炮你","泡你"]; for(var i=0;i < dirty.length;i++) if(form1.j2h5.value.replace(/ /gi, "").indexOf(dirty[i])!=-1) { location="index.php"; return(false); } var dirty = ["lovergirlever.com","live173.com?","money.tw","[/url]","tww633","汽車借錢","機車借錢","當舖","你找我找他","u-mao","love5955.com","wscs191010","pp2.idv.tw","ppt.cc","is.gd","weebly.com","茶坊","dd93751","EM.crew.tw ","yodidi.com","wagn886","yhoosec","sallyas1990","xolove525","xolove521","yudidi.com","vions.net","qiqi7789","大和賞","xolove","現金消費","llxllx111","不轉帳","不刷卡","bule88088","love_520ve","baydu520","phoebe15840","ck077","goo.gl","在家兼職","now.to","網路專兼職","電腦操作網路宣傳","九十天免費試用","HBEE","mikehang63","ftp.cc","xiaodie91","staiwan.com","abc173.com","blogspot.com","fashion3c.url.tw","ligsystem.com","twmis.net","neopets.com","so-ya4","無碼","情色網","av808.com","hjchung.tw","slime.com.tw","vovo2000.com","Hung-Ya.com","lookm.com","hisyy.com","msi-team.com","homework123.com","twcam.com","qoo.av-city","arx.myweb.hinet.net","sogood.why.to","a href","dvd888.com","neopets.com","kan120.com","x-adam.com","hung-ya.com","gigicry.com","msi.168.lv","dy8.com","2sextv.com","嘗鮮專線","現金收費","kelly_shop","批發切貨","zxcvb001cm","moneymine.net","成人貼圖","兼職做援","全套服務","哥哥約愛","weilon.no-ip.com","[/url]","[url=","top20free.com","breaki77ing","c329646","xyz22.com","snow258.com","love5955.com","5280344","qwe3300923","nini9595","besttuboonline.com","srvo.idv","eyny.com","besttuboonline.com","his_funky_style","dancerhiphop","coolgo.com","libb.co","xin-yuan.tw","27756599","567pan.com","boy4628241","fashion3c","0938009789","besttuboonline.com","yuonuom.com","weebly.com","tw9m.com","蜻蜓飛舞","yunupload.net","jolin578","0909873168","live173.com","美女視訊",".com","http"]; for(var i=0;i < dirty.length;i++) if(form1.j2h5.value.replace(/ /gi, "").indexOf(dirty[i])!=-1) { location="http://www.j2h.tw/bbs/bombersuper.php"; return(false); } if(form1.j2h4.value!='' && form1.j2h10.value=='') { alert("請務必選擇正確連結檔案!"); return(false); } var dirty = ["http://www.wretch.cc/album/","http://www.wretch.cc/blog/",".exe","yahoo.com","C:","care-you","j2h.tw",".html",".htm","@","www.soo-easy.com/shaonv.mp3"]; for(var i=0;i < dirty.length;i++) if(form1.j2h4.value.indexOf(dirty[i])!=-1) { alert("連結網址方式錯誤,\n新手討論區有相關教學請至那邊學習或測試,\n以免被版主列為黑名單"); location="http://www.j2h.tw/bbs/bbs14/j2h.php?id=3378"; return(false); } return(true); } </script> <table width="90%" height=65 border="1" cellpadding=1 cellspacing=0 bordercolorlight=#346783 bordercolordark=#FFFFFF bgcolor="#F0F9FF"> <tr align="center"> <input type="hidden" name="username" value=""> <td width="14%" ALIGN="left" VALIGN="TOP" NOWRAP>姓名:</td> <td align="left" colspan=3><input NAME="j2h" MAXLENGTH="16" SIZE="60" value=''> </td> </tr> <tr align="center"> <td ALIGN="left" VALIGN="TOP" NOWRAP>佈告內容:</td> <td align="left" colspan=3> <textarea name="j2h5" ROWS="15" COLS="80" ></textarea> </td> </tr> <tr align="center"> <td ALIGN="RIGHT" VALIGN="TOP" NOWRAP colspan="4"> <p align="center"><br> <input type=submit value='確定發言' onClick="this.disable=true;"> </td></tr></table></form> </center></body></html>