below is my html looks like and the problem with my page is that, i have duplicate class names so for an example in my page i have class="inner" mulitple times in the same page.
My questions is: how can i grab the the text which says Get this text using cssSelector ?
<div class="tools-col-right">
<div class="subcr">
<div .....</div>
<div .....</div>
<div .....</div>
<div class="main-inner">
<div class="inner">
<div class="t"></div>
<h3> additional information</h3>
<div class="subcolumns">
<div class="subject">
<ul>
<li>....</li>
<li>....</li>
<li>....</li>
<li>....</li>
</ul>
</div>
</div>
</div>
</div>
I am trying to get the text of div class='subject'
tried something like this: div[class='tools-col-right .subject']
but does not work.
There are countless ways. Which might work depends on your whole page markup (you only gave an extract of your page, with no other
.innerelements).EDIT after your updated code:
Now you only have one element with the class
subject. Again, without your whole markup (containing the other elements with the same class), it’s not possible to give you a safe answer. With your example, each of the following selectors should work: