Is there any CSS selector (comma) in XPath, so I could find the select items, say //img and //*[@background] in the same query?
//img
//*[@background]
XPath has the or ( | ) operator:
or
|
//img|//*[@background]
Yes, this is a pipe ( | ).
//img | //*[@background]
Use | for example: //img | //*[@background] //img | //*[@background]
In addition to the "combined" operator | , which exists in XPath 1.0 and 2.0, there is also a comma operator in XPath 2.0 for forming a sequence of elements, for example //img, //*[@background] .
//img, //*[@background]