f3lix 3rown
f3lix 3rown

Reputation: 127

Chrome Console get values from xpath array

I'm using the Google Chrome Console to get an array of all the elements that have a class of attrValue. This is what I'm using:

$x('//*[@class="attrValue"]');

And this is my output:

<td class="attrValue">Transway 1A</td>, <td class="attrValue">Northbound/Westbound</td>, <td class="attrValue">Facing West</td>

It works great to get an array of all the elements but I am trying to get an array of the values within those elements. Any help would be greatly appreciated.

Upvotes: 3

Views: 9625

Answers (1)

alecxe
alecxe

Reputation: 474091

Get the text():

$x('//*[@class="attrValue"]/text()');

Upvotes: 6

Related Questions