0.2.2 • Published 10 years ago
bauer-plugin-scrape v0.2.2
bauer-plugin-scrape
Plugin for bauer to make http requests.
Installation
npm install bauer-plugin-scrapeUsage
module.exports = function(promise) {
return promise.scrape("/path/to/html/input",{
"a[href]": {
"url": "attr:href"
}
}).then(function(outputFile) {
// outputFile contains scraped data
});
};module.exports = function(promise) {
return promise.return("/path/to/html/input")
.scrape({
"a[href]": {
"url": "attr:href"
}
}).then(function(outputFile) {
// outputFile contains scraped data
});
};Configuration
{
workers: 1,
slots: 1,
delay: 0,
cache: { // default options for bauer-cache
json: false,
expires: "1d",
file: {
dir: ".",
ext: "txt"
}
}
}API Summary
Promise.scrape(scrape Object) :Promise.scrape(source String, scrape Object) :Promise