I have a span with some id; and within that span, there is both a paragraph p tag and some text with no tags as follows. I am using selenium webdriver to target the street address below.
<span id="myspan">
<p>fullname</p>
street address - has no tags attributes.
</span>
I need to target the street address ONLY without the fullname.
I was thinking something like this:
span#myspan.not(p) // select all content of the span element, then ignore the p
tag within it, so that only the street address is left.
//
driver.findelement(By.cssSelector("span#myspan.not(p)")) // should select street
address
Thanks again for your help.