Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97773

Python Selenium - can't get elements by xpath

$
0
0
<table class="wikitable" style="float: right;">
    <caption>Current UTC
    </caption>
    <tbody><tr>
    <td>**January 26, 2020 01:13:27 (UTC) –** <span class="plainlinks" id="purgelink"><span class="nowrap"><a class="external text" href="https://en.wikipedia.org/w/index.php?title=Coordinated_Universal_Time&amp;action=purge">Refresh</a></span></span>

</td></tr></tbody></table>

I just need to get the date. I tried:

utc = driver.find_element_by_xpath('//*[@id="mw-content-text"]/div/table[1]/tbody/tr/td/text()')

ERROR:

invalid selector: The result of the xpath expression is: [object Text]. It should be an element.

Please help.


Viewing all articles
Browse latest Browse all 97773

Trending Articles