bquery
Version:
bquery is a useful node module to fetch web page, which use css selector to fetch and structure this html page content.
30 lines (22 loc) • 750 B
Markdown
category: reference
heading: 'Error handling'
Noodle will fire various errors which one can listen for with the `fail()`
handler.
noodle.html.fetch(query)
.then(function (result) {
console.log('The results are', results);
})
.fail(function (error) {
console.log('Uh oh, ' error.message);
});
## Possible errors
The noodle module itself emits only one error:
- `"Document not found"` when a targetted url is not found.
Were as the specific document type modules emit their own but should bubble
up to the main `noodle.query` method.
- `'Could not parse XML to JSON'`
- `'Could not parse JSON document'`
- `'Could not match with that selector'`
- `'Could not match with that selector or extract value'`