火车采集器软件交流官方论坛

 找回密码
 加入会员
搜索
火车采集器V9版免费下载火车浏览器 - 可视采集,万能群发,全自动脚本工具
查看: 2029|回复: 3

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

[复制链接]
发表于 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>
                <!-- 翻页结束 -->
发表于 2011-5-7 21:17:42 | 显示全部楼层
可以做的。如果有需要可以联系我定制。
发表于 2011-5-7 21:37:28 | 显示全部楼层
真晕,有点难度呀。
发表于 2011-5-7 23:34:40 | 显示全部楼层
看着头疼。。。。。。。。。。。。。
您需要登录后才可以回帖 登录 | 加入会员

本版积分规则

QQ|手机版|Archiver|火车采集器官方站 ( 皖ICP备06000549 )

GMT+8, 2025-4-11 13:17

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表