Issue
I want to extract shipping fees from the html page. But there are two types of html pages from which I need to extract the shipping fees.
for one page the Xpath is
//*[@class="flex flex-row justify-between f6 mid-gray pt2"]//div[2]/text()
for another page the Xpath is
//*[@class="mid-gray flex items-center"]//span/text()
Now I want to combine the above Xpaths as one so that if any one of the condition met it should extract the value (https://i.stack.imgur.com/wIRWp.png) (https://i.stack.imgur.com/9PqU3.png)
Solution
try this:
(//*[@class="flex flex-row justify-between f6 mid-gray pt2"]/div[@class="green"]
|
//*[@class="mid-gray flex items-center"]/span)[1]/text()
Explanation:
Surround the two with ()
and the |
combines the two, and [1]
selects the first of those two
Answered By - Siebe Jongebloed
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.