Fix identify and script scraper bugs (#2375)

* Continue identify if source fails
* Handle empty result set correctly
* Parse null values from scraper script correctly
* Omit warning when json selector value missing
* Return nil when scraped item not found
* Fix graphql validation errors
This commit is contained in:
WithoutPants
2022-03-15 09:42:22 +11:00
committed by GitHub
parent e4d6d3b085
commit 9e3d56b22f
11 changed files with 86 additions and 37 deletions

View File

@@ -258,7 +258,10 @@ func (q *jsonQuery) runQuery(selector string) ([]string, error) {
value := gjson.Get(q.doc, selector)
if !value.Exists() {
return nil, fmt.Errorf("could not find json path '%s' in json object", selector)
// many possible reasons why the selector may not be in the json object
// and not all are errors.
// Just return nil
return nil, nil
}
var ret []string