0.1.7 • Published 9 years ago

kspider v0.1.7

Weekly downloads
2
License
MIT
Repository
github
Last release
9 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

9 years ago

0.1.6

9 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago