New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qiguo_ganther

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qiguo_ganther

qiguo curl[fetch]

0.1.8
latest
npm
Version published
Maintainers
1
Created
Source

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);
});


Keywords

qiguo_ganther

FAQs

Package last updated on 05 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts