Nice! Do you write them out by hand, or make use of any libraries or tools to help you compose them? I've been experimenting with a few different ways to express XPaths.
Raw XPath:
//*[@id='attr-number']//*[@data-price >= 5]
XPath with embedded CSS selectors:
`${css('#attr-number')}`
XPath with LISP-style helper functions:
(anyNode
(tag
('*',
attrEquals('id', 'attr-number',
anyNode
(tag
('*',
attrGreaterEquals('data-price', '5')))))))
XPath with JS-style helper functions:
xpath()
.anyNode()
.tag('*')
.attrEquals('id', 'attr-number')
.anyNode()
.tag('*')
.attrGreaterEquals('data-price', '5')
.value
And I'm sure there are many more ways you could approach writing and composing XPath selectors. Do you use any helpers like this, or know of any preprocessors or tools that help people get the XPath they need written down without necessarily having to write it all out by hand?