aisoocom 发表于 2011-5-7 18:30:17

很牛的网页,看谁能采集分页

文章网址:http://www.cs.com.cn/gmkt/01/201104/t20110418_2847524.html

<!-- 翻页 -->
                <div class="z_page"><SCRIPT LANGUAGE="JavaScript">
var currentPage = 1;//所在页从0开始
var prevPage = currentPage-1//上一页
var nextPage = currentPage+1//下一页
var countPage = 2//共多少页

//设置上一页代码
if(countPage>1&&currentPage!=0&&currentPage!=1)
        document.write("<a href=\"t20110418_2847524.html\" target='_self'>首页</a> <a href=\"t20110418_2847524"+"_" + prevPage + "."+"html\" target='_self'>上一页</a>");
else if(countPage>1&&currentPage!=0&&currentPage==1)
        document.write("<a href=\"t20110418_2847524.html\" target='_self'>首页</a> <a href=\"t20110418_2847524.html\" target='_self'>上一页</a>");
else
        document.write("<span class=z_page_none>首页</span> <span class=z_page_none>上一页</span>");
//循环

document.write("&nbsp;第");
var num = 10;
for(var i=0+(currentPage-1-(currentPage-1)%num) ; i<=(num+(currentPage-1-(currentPage-1)%num))&&(i<countPage) ; i++){
        if(currentPage==i)
                document.write(" <span class=z_page_now>["+(i+1)+"]</span>");
        else{
            if(i==0)
                   document.write(" <a href=\"t20110418_2847524" + "."+"html\" target='_self'>["+(i+1)+"]</a>");
                  else
                     document.write(" <a href=\"t20110418_2847524"+"_" + i + "."+"html\" target='_self'>["+(i+1)+"]</a>");
             }
}

document.write("&nbsp;页&nbsp;");

//设置下一页代码
if(countPage>1&&currentPage!=(countPage-1))
        document.write("<a href=\"t20110418_2847524"+"_" + nextPage + "."+"html\" target='_self'>下一页</a> <a href=\"t20110418_2847524_" + (countPage-1) + ".html\" target='_self'>尾页</a>");
else
        document.write("<span class=z_page_none>下一页</span> <span class=z_page_none>尾页</span>");

</SCRIPT></div>
                <!-- 翻页结束 -->

303718 发表于 2011-5-7 21:17:42

可以做的。如果有需要可以联系我定制。

fswenly 发表于 2011-5-7 21:37:28

真晕,有点难度呀。

ywp1611 发表于 2011-5-7 23:34:40

看着头疼。。。。。。。。。。。。。
页: [1]
查看完整版本: 很牛的网页,看谁能采集分页