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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -