Example of a custom validator for HTML parsing result (css)

Solving this problem:


I tried to implement a custom validator to apply it on the result of the css selector.

For example I want to get an error message “Wrong ID on ${h1}”, if the page id is invalid. Something like this:


.check(css("#id").validate(new ContainsOnlyDigits("${h1}"))

Does somebody have an example of such a validator? I did not manage to write such a validator it :frowning: