qiguo_ganther
qiguo curl[fetch]
Last updated 2 years ago by metro .
ISC · Repository · Original npm · Tarball
$ cnpm install qiguo_ganther 
SYNC missed versions from official npm registry.

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. 'data[0].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);
});


Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (1)
Dependents (2)

Copyright 2014 - 2017 © taobao.org |