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

how do i retrieve the text which is under div tag in Selenium

$
0
0

I do have to fetch all 21 values and print it on console which are under div tag. When i am writing path //div[@class='grid']/div/div[1], its giving me 21 div tags(elements) as a result and each of div tag contains anchor tag which having some text and that text want to print on my console.

Here is the code:

//div[@class='grid-canvas']/div/div[1] --Giving 21 elements. And when i expand this div tag, it's like as below shown..

Which contains tag. Manager Which contains tag. Employee

I want to print on console the text of all 21 elements, such as Manager, Employee and so on. Please anyone can help me out?. Thanks!!


Viewing all articles
Browse latest Browse all 97777

Trending Articles



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