scraper-framework
v2.0.0
Published
scraper framework
Downloads
2
Readme
#Scraper engine
complate solutions for build scraper API service, easy to use
#How to use
npm install scraper-engine
create app.js and write
var port=4000;
require('scraper-engine').start(__dirname,port);
$ node app.js
Scraper Engine Started (port 4000)...
and open your browser
http://localhost:4000/output.json?site=controller
example controller
http://localhost:4000/output.json?site=4shared&key=bruno
##How it work
Example: Olx Controller
var S = require('string');
exports.scraper = {
name: 'OLX',
url: function () {
return "http://olx.co.id/all-results/q-batu-bacan/"
},
rows: function ($) {
return $('.offer');
},
fields: {
title: function ($) {
return S($.find('.link.linkWithHash').text()).trim().s;
},
price: function ($) {
return S($.find('.price').text()).trim().s;
},
image: function ($) {
return $.find('.linkWithHash img').attr('src');
}
}
}
#Author ##[email protected]