lundi 30 mars 2020

Selenium - how to get text when element contains text + element

I have elements like this:

<div id="x">
"abc"
<strong>xyz</strong>
"def"
</div>

I am trying:

getDriver().findElement(By.id("x")).getText()

Result is empty string.

Aucun commentaire:

Enregistrer un commentaire