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

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

这个JS分页怎么采

[复制链接]
发表于 2009-3-18 11:08:48 | 显示全部楼层 |阅读模式
原文地址http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385

头部JS
  1. <script>
  2. var totalNum=21;
  3.                                                                         var nowNum=1;
  4.                                                                         var pagelist=new Array();
  5.                                                                                        
  6.                                                                                         pagelist[1] ="<!CMS_PAGER_LOOP_URL!>";
  7.                                                                                        
  8.                                                                                         pagelist[2] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_1.html";
  9.                                                                                        
  10.                                                                                         pagelist[3] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_2.html";
  11.                                                                                        
  12.                                                                                         pagelist[4] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_3.html";
  13.                                                                                        
  14.                                                                                         pagelist[5] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_4.html";
  15.                                                                                        
  16.                                                                                         pagelist[6] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_5.html";
  17.                                                                                        
  18.                                                                                         pagelist[7] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_6.html";
  19.                                                                                        
  20.                                                                                         pagelist[8] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_7.html";
  21.                                                                                        
  22.                                                                                         pagelist[9] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_8.html";
  23.                                                                                        
  24.                                                                                         pagelist[10] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_9.html";
  25.                                                                                        
  26.                                                                                         pagelist[11] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_10.html";
  27.                                                                                        
  28.                                                                                         pagelist[12] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_11.html";
  29.                                                                                        
  30.                                                                                         pagelist[13] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_12.html";
  31.                                                                                        
  32.                                                                                         pagelist[14] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_13.html";
  33.                                                                                        
  34.                                                                                         pagelist[15] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_14.html";
  35.                                                                                        
  36.                                                                                         pagelist[16] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_15.html";
  37.                                                                                        
  38.                                                                                         pagelist[17] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_16.html";
  39.                                                                                        
  40.                                                                                         pagelist[18] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_17.html";
  41.                                                                                        
  42.                                                                                         pagelist[19] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_18.html";
  43.                                                                                        
  44.                                                                                         pagelist[20] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_19.html";
  45.                                                                                        
  46.                                                                                         pagelist[21] ="http://fashion.rayli.com.cn/0002/2009-02-19/L0002010002_359385_20.html";
  47.                                                                                        
  48.                                                                         var loopNum;
  49. </script>
复制代码

调用部分
  1. <script>
  2.                                                                        
  3.                                                                         if (nowNum<6){
  4.                                                                                 loopNum=(10-nowNum)+1;
  5.                                                                         }else{
  6.                                                                                 loopNum=6
  7.                                                                         }
  8.                                                                         var i=nowNum-4;
  9.                                                                         if (totalNum!=1){
  10.                                                                                         if (nowNum!=1){

  11. document.write('<div class="leftline"><br
  12. /></div><div class="offN"><a
  13. href="http://fashion.rayli.com.cn/0002/2009-02-19
  14. /L0002010002_359385.html">首页</a></div><div
  15. class="offN"><a
  16. href="http://fashion.rayli.com.cn/0002/2009-02-19
  17. /L0002010002_359385.html">上一页</a></div>');
  18.                                                                                         }else{
  19.                                                                                                 document.write('<div class="leftline"><br /></div>');
  20.                                                                                         }
  21.                                                                                
  22.                                                                                         for (i;i<nowNum;i++){
  23.                                                                                                 if((i>0)&&(i<totalNum+1)){                       
  24.                                                                                                                 document.write('<div class="offN"><a href="'+pagelist[i]+'">'+i+'</a></div>');
  25.                                                                                                        
  26.                                                                                                 }
  27.                                                                                         }
  28.                                                                                                 if((i>0)&&(i<totalNum+1)){
  29.                                                                                                         document.write('<div class="nowN">'+nowNum+'</div>');
  30.                                                                                                 }
  31.                                                                                
  32.                                                                                         for (i=nowNum+1;i<nowNum+loopNum;i++){
  33.                                                                                                 if(i<totalNum+1){
  34.                                                                                                         document.write('<div class="offN"><a href="'+pagelist[i]+'">'+i+'</a></div>');
  35.                                                                                                 }
  36.                                                                                         }
  37.                                                                                        
  38.                                                                                         if (nowNum!=totalNum){

  39. document.write('<div class="offN"><a
  40. href="http://fashion.rayli.com.cn/0002/2009-02-19
  41. /L0002010002_359385_1.html">下一页</a></div><div
  42. class="offN"><a
  43. href="http://fashion.rayli.com.cn/0002/2009-02-19
  44. /L0002010002_359385_20.html">末页</a></div><div
  45. style="width:15px; float:left;"><br /></div>');
  46.                                                                                         }else{
  47.                                                                                                 document.write('<div style="width:15px; float:left;"><br /></div>');
  48.                                                                                         }
  49.                                                                 }
  50.                                                                 </script>        
复制代码
发表于 2009-3-18 12:35:17 | 显示全部楼层
瑞丽女性网的分页采集的 呵呵  其实你不要看下面的JS分页
发表于 2009-3-18 17:08:28 | 显示全部楼层
本帖最后由 longtan 于 2009-3-18 17:34 编辑

路过!!~!!         
发表于 2009-3-20 23:09:12 | 显示全部楼层
这个要支持一下.
您需要登录后才可以回帖 登录 | 加入会员

本版积分规则

企业微信|手机版|Archiver|火车采集器官方站 ( 皖ICP备06000549 )

GMT+8, 2026-4-25 22:12

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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