Chrome 控制台从 xpath 数组中获取值

f3l*_*own 2 html xpath google-chrome google-chrome-devtools

我正在使用 Google Chrome 控制台获取所有具有attrValue. 这是我正在使用的:

$x('//*[@class="attrValue"]');
Run Code Online (Sandbox Code Playgroud)

这是我的输出:

<td class="attrValue">Transway 1A</td>, <td class="attrValue">Northbound/Westbound</td>, <td class="attrValue">Facing West</td>
Run Code Online (Sandbox Code Playgroud)

获取所有元素的数组非常有效,但我正在尝试获取这些元素中的值数组。任何帮助将不胜感激。

ale*_*cxe 5

获取text()

$x('//*[@class="attrValue"]/text()');
Run Code Online (Sandbox Code Playgroud)