0.1.8 • Published 8 years ago

qiguo_ganther v0.1.8

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

qiguo_gather

提供一个handle的接口

  • handle 提供两个接口 addRule,exec
  • handle args -> url, rule, wait, waitFn
  • url 抓取的地址
  • rule 抓取的规则

    • dom args exe: 1 选择器字符串 2 要去的类型 (属性[],text,html)

    • interface args exe: 1 url(请求url) 2. 'data0.bittype'(json定位)

    • self args exe 1.self

    • page-str args exe: 1. start(开始符) 2. end(结束符)

  • wait 页面是否需要延迟获取这个一般和waitFn一起

  • waitFn 当有wait参数时 什么时候获取页面 方法写在waitFn里
var rule = 'xxxxxx';
var url = 'https://item.taobao.com/item.htm?id=520003539079';

var h = handle(url,null,true,function check(){
  return true;
});

h.addRule({off:{type:"dom",args:["#J_RateCounter","text"]}});

h.exec(function(err, html, api){
  console.log(api);
});
0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago