New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

kspider

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kspider

Simple web page spider

latest
Source
npmnpm
Version
0.1.7
Version published
Maintainers
1
Created
Source

kspider

Usages



var kspider = require("kspider");

kspider.get("https://github.com/AKIo0O/kspider", function($){

    var title = $("html head title").html();// jquery selector

    console.log(title); //  AKIo0O/kspider
});

// co

co(function*(){
    
    
    var $ = yield kspider.coget("https://github.com/AKIo0O/kspider");

    console.log($("html head title").html());// AKIo0O/kspider

});


use with rules


var kspider = require("kspider");

var rules = {
	title: {
		get: function($){
			var tags = [];
			$(".l .mainer>.item a.title").each((i,el) => tags.push($(el).html()));
			return tags;
		}
	},
	adImage: {
		selector: ".ad.ad-right img",
		attr: "src",
		base64: true
	},
	links: {
		selector: ".l .mainer>.item a.title",
		attr: "href",
	},
	tabTitle: {
		selector: ".tab.fixed.active",
		text: "html"
	}
}

kspider.processWithRules("http://www.acfun.tv/v/list73/index.htm", rules , function(err, array){

	console.log(err, array)// null, {title: [...titles], adImage: "base64 Image Data", links: "...hrefs", tabTitle:""}

});

Keywords

spider

FAQs

Package last updated on 28 Feb 2017

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