The minimum structure to assert
Element exists, has the expected attribute, and the attribute value is one of the allowed set. Those three cover most markup bugs.
When grep is enough
For a single stable marker in a small page. The moment the assertion needs a place or a count, switch to a parser.