日期:2014-05-17 浏览次数:20539 次
<?php for($i=2;$i<30;$i++) { $ch = curl_init("http://www.readnovel.com/novel/169509/$i.html"); $fp = fopen("novel-$i.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_TIMEOUT, "100"); curl_exec($ch); curl_close($ch); fclose($fp); echo "第".$i."页成功保存</br>"; } echo "抓取完成"; ?>