Reputation: 59
I use the following X-path to extract a web element based on the starts-with condition
//a[starts-with(@href,'https://test-abc-eu.softcore.com')]
I want to increase the scope of the search by adding a logical OR condition to the search. Anything that starts with
//a[starts-with(@href,'https://test-abc-eu.softcore.com')]
//a[starts-with(@href,'https://test-abc.softcore.com')]
Something like
//a[starts-with(@href,'https://test-abc-eu.softcore.com' or @href,'https://test-abc.softcore.com')]
Is this possible? Any help would be appreciated. Thanks.
Upvotes: 0
Views: 76
Reputation: 168122
The correct syntax would be:
//a[starts-with(@href,'http://test-abc.softcore.com') or starts-with(@href,'https://test-abc-eu.softcore.com')]
Demo:
As you can see both links are matched.
References:
Upvotes: 1