0.1.7 • Published 7 years ago

kspider v0.1.7

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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:""}

});
0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago