Releases: masterT/yolo-scraper
Releases · masterT/yolo-scraper
v0.2.0
ValidationError
Error instance with additional Object property errorObjects
which content all the error information, see ajv error.
ListValidationError
Error instance with additional Array property validationError
of ValidationError
instance.
options.paramsSchema
The JSON schema that defines the shape of the accepted arguments passed to options.request
. When invalid, an Error will be thrown.
Optional
options.validateList
Use this option to validate each item of the data extracted individually. When true
, the data extracted is required to be an Array, otherwise an Error is returned in callback.
Optional, default: false
scraper function callback(error, data)
- When a network request error occurred, the callback
error
argument will be an Error and thedata
will be null. - When
options.validateList = false
and a validation error occurred,error
will be a ValidationError and thedata
will be null. Otherwise, theerror
will be null anddata
will be the returned value ofoptions.extract
. - When
options.validateList = true
and a validation errors occurred,error
will be a ListValidationError, otherwise it will be null. If the value returned byoptions.extract
is not an Array,error
will be an instance of Error. Thedata
always be an Array that only contains the valid item returned byoptions.extract
. It's not becauseerror
is a ListValidationError that there will be nodata
!