selenium - How to get value between parent and child node using xpath? -
i want extract vale between parent , child node using xpath. how achieve that?
**<div class="shareaccess"> value extract <a href="javascript:shareaccessvalue()" id="sharekey"> key </a> <span></span> </div>**
how text value output 'value extract'? should not 'value extract key'. 'key' should ignored.
you can remove child text result
java syntax
string alltext = driver.findelement(by.classname("shareaccess")).gettext(); string childtext = driver.findelement(by.id("sharekey")).gettext(); string parenttext = alltext.replace(childtext, "");
parenttext
"value extract"
Comments
Post a Comment