bauer-plugin-scrape
v0.2.2
Published
Plugin for bauer to scrape content.
Downloads
7
Maintainers
Readme
bauer-plugin-scrape
Plugin for bauer
to make http requests.
Installation
npm install bauer-plugin-scrape
Usage
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