<td>
<span class="td-title">city</span>
<span>city</span>
" Japan"
</td>
How to locate element on text by using XPath? I tried to use /td/text()
but it showed "td/text()" is: [object Text]. It should be an element.
If I use /td
it will return city city Japan
, but I want the only output is Japan
.
I cannot use contain()
or /td[text() = 'Japan']
to specific city "Japan", because I also want to find multiple different cities. If I use this functions, I'll have to manually change city's name every time.