Xpath:如何在另一个标签中的标签内获取文本?

时间:2016-12-06 12:04:06

标签: xml xpath

我需要一个xpath来获取每个表行中的文本:

<span class="hoverQP" onmouseout="hideddrivetip();" onmouseover="ddrivetip('<div class=\'qtyPriceBorder\'><table border=0 cellspacing=0 cellpadding=0 width=\'100%\'><tr><td colspan=2 class=\'qtyPriceHeader\'>Quantity Pricing Available!</td></tr><tr class=\'qtyPriceRow\'><td>1 - 11</td><td>$63.23 ea.</td></tr><tr class=\'qtyPriceRow\'><td>12+</td><td>$60.45 ea.</td></tr></table></div>', 300);">Hover for Qty Pricing</span>

格式化以便于阅读:

<span class="hoverQP" onmouseout="hideddrivetip();" onmouseover="ddrivetip('
    <div class=\'qtyPriceBorder\'>
        <table border=0 cellspacing=0 cellpadding=0 width=\'100%\'>
            <tr>
                <td colspan=2 class=\'qtyPriceHeader\'>Quantity Pricing Available!</td>
            </tr>
            <tr class=\'qtyPriceRow\'>
                <td>1 - 11</td>
                <td>$63.23 ea.</td>
            </tr>
            <tr class=\'qtyPriceRow\'>
                <td>12+</td>
                <td>$60.45 ea.</td>
            </tr>
        </table>
    </div>'
    , 300
);">Hover for Qty Pricing</span>

网页网址:http://www.skygeek.com/phillips-xc-20w50-aircraft-oil.html

上面的span标签出现在:.// * [@class='bundleItemTable']/tbody/tr/td[1]/form/table/tbody/tr[2]/td[4]

0 个答案:

没有答案