Please help using the logical OR operator in XPATH and select one query from these two:
1) .//span[@class=\'fob12\']
.//span[@class=\'fob12\']
2) .//p[@class=\'fob12\']
.//p[@class=\'fob12\']
They differ only in tag.
One more (with OR request):
".//*[(self::p or self::span) and @class = 'fob12']"
Do you want a union expression that is | therefore XPath will:
|
.//span[@class="fob12"] | .//p[@class="fob12"]
Maybe I missed something, but the following should work !?
.//span[@class=\'fob12\'] | .//p[@class=\'fob12\']
I would write it as .//(p|span)[@class='fob12'] . But I think it requires XPath 2.0 IIRC.
.//(p|span)[@class='fob12']
Another XPath:
.//*[(self::p | self::span)[@class = 'fob12']]