-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how can return values be guaranteed? #265
Comments
the first problem is that you use the same objSite object for two separate chains, so you overwrite the previous defined data/done functions (is i understand) -> you should put them together:
BUT: with this solution if e.g. selector1 was not found in the DOM the chain breaks and done is called (works as implemented, s. lib/commands/find.js:42). only solution i know would be to create multiple separate objSite objects (multiple site visits), then you can ignore if one does not resolve any value. or is there a functionality in the library to ignore find errors? |
thx yes |
you can use "do" for this only the "do" block will fall if the selector is not found example:
|
is it possible that a return value is guaranteed?
because if one "find" doesn not find anything the whole data is empty
so I tried this code but it only returns the first value??
=> output
strFileData:[
{
"kurs": "71,39"
}
]
original example which works if all xpath queries find something
=> output
strFileData:[
{
"kurs": "71,39",
"perc": "+0,08"
}
]
The text was updated successfully, but these errors were encountered: