Reputation: 115
Suppose the following HTML
< div class="entry" >
< div class="partial_entry" >
Hello
< /div>
< /div>
I want to select Hello using Xpath...Select all elements with class partial_entry where parent is of class entry..
Upvotes: 2
Views: 4946
Reputation: 164
In Chrome Dev Tools or Firebug, in their DOM views("HTML" bookmark in Firebug and "Elements" bookmark in Chrome Dev Tools) you can quickly get an element xpath by righ-clicking it and selecting "copy XPath".
Upvotes: 2
Reputation: 440
Try this:
//div[@class='entry']/div[@class='partial_entry']/text()
Upvotes: 4