0

My question looks similar to XPath with multiple contains on different elements, but i try solution and cant get correct result. May be I do some wrong. So i have table:

<div id="openTrades" style="display: block"><table>
<tbody>
<tr>
    <td>95326</td>
    <td>BRENT_OIL</td>
    <td>2019-10-29 11:51:14</td>
    <td>1</td>
    <td>20</td>
    <td>60.67</td>
    <td>buy</td>
</tr>
<tr>
    <td>95325</td>
    <td>SILVER</td>
    <td>2019-10-29 10:38:26</td>
    <td>1</td><td>20</td>
    <td>17.545</td>
    <td>sell</td>
</tr>
</tbody>
</div>

So i try get all cells with date "2019-10-29" and "sell" status. I try to use x-path:

'//*[@id="openTrades"]//tr[contains(td,"buy") and contains(td,"2019-10-29")]'

and

'//*[@id="openTrades"]/table/tbody//tr/*[contains(td,"sell") and contains(td,"2019-10-29")]'

i cant get no one element.

Also for

'//*[@id="openTrades"]/table/tbody//tr/*[self::td[contains(.,"sell")] or self::td[contains(.,"2019-10-29")]]'

i get 58 elements - 57 with contains(.,"2019-10-29") and 1 with contains(.,"sell") but when i use

'//*[@id="openTrades"]/table/tbody//tr/*[self::td[contains(.,"sell")] and self::td[contains(.,"2019-10-29")]]'

i cant get no one.

Please, help me.

1 Answers1

0

I found solution myself:

'//*[@id="openTrades"]//td[contains(.,"2019-10-29")]/../td[contains(.,"sell")]'

other way aply to 'tr':

'//tr[contains(.,"2019-10-29") and contains(.,"sell") ]'

you can add more then two value