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

Selenium java can't get html text

$
0
0

I have this HTML code:

<span id="slotTotal">
    <span id="slotUsed">4</span>
          /16
</span>

I want to get text /16 but when I try:

slotTot = driver.findElement(By.xpath("//*[@id='slotTotal']")).getText();

I get this Exception: org.openqa.selenium.InvalidSelectorException: invalid selector while trying to locate an element

How can I fix that? (If I get 4/16 is good too...) thanks in advance


Viewing all articles
Browse latest Browse all 98787

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>