0
我有一個TA情況下我找到的XPath元素(很長的一個)XPath表達式來選擇鏈接文本與子div的
$x("//tr[./td[contains(@class, 'description_short') and .//a[contains(@class, 'descShort') and normalize-space(text()) = normalize-space('xxxxxxxxx')]]]/.//img[starts-with(@id, 'tocart_')]")$x("//tr[./td[contains(@class, 'description_short') and .//a[contains(@class, 'descShort')]]]/.//img[starts-with(@id, 'tocart_')]")
它不再起作用,因爲有人爲與璀璨的想法來到突出鏈接名稱中的單詞使text()返回null。
新的案文是:
<a href="#" class="x-dig-articleDetailSpx descShort"><b class="x-dig-articleDetailSpx descShort"><b class="x-dig-articleDetailSpx descShort">MDI,</b></b> P<b class="x-dig-articleDetailSpx descShort"><b class="x-dig-articleDetailSpx descShort">MDI,</b></b> <b class="x-dig-articleDetailSpx descShort">Isocyanat,MDF,</b> <b class="x-dig-articleDetailSpx descShort">Huntsman</b></a>
舊是:
<a href="#" class="x-dig-articleDetailSpx descShort"><b class="x-dig-articleDetailSpx descShort">xxxxxx</a>
我不知道如何得到新的混亂......任何人的想法的文本?