1

I'm trying to do an or between = and contains. I know how to do or between multiple contains but not multiple equals. I want to do something like this but it's not working:

xpath=//*[text()[="HOA fees" or [contains(.,"HOA fee:")]]]/following-sibling::*
kjhughes
  • 106,133
  • 27
  • 181
  • 240
823g4n8901
  • 139
  • 1
  • 11

1 Answers1

1

To fix your syntax problem, change

//*[text()[="HOA fees" or [contains(.,"HOA fee:")]]]/following-sibling::*

to

//*[text()[.="HOA fees" or contains(.,"HOA fee:")]]/following-sibling::*

This will select all sibling elements following all elements with a text node child that equals HOA fees or has a HOA fee: substring. If that's not exactly what you had in mind, follow-up in comments to clarify your actual goal.

See also:

kjhughes
  • 106,133
  • 27
  • 181
  • 240