xpath icon indicating copy to clipboard operation
xpath copied to clipboard

xpath error

Open 474420502 opened this issue 5 years ago • 3 comments

(//span[@class='tw-user-nav-list-count']/text())[2] xpath. the result is null. chrome check it. result is exist. test.zip

474420502 avatar Aug 18 '20 08:08 474420502

change to //span[@class='tw-user-nav-list-count'][2]/text()

text() function will return text node on the antch's xpath library. you should return Node object and then call text().

By the way, I found your xpath expression had a problem: [@Class='tw-user-nav-list-count']. You should change Class='' to the lower-letters class='', XPath library is case sensitivity for the query expression, your HTML page uses class lower-letters not Class first uppercase.

zhengchun avatar Aug 18 '20 09:08 zhengchun

@zhengchun Class is auto transformed by System! I know how to correct it. I only tell you that is different to chrome xpath.

image

I think the logic implemented by xpath is not perfect.

474420502 avatar Aug 18 '20 10:08 474420502

Okay, I got that what your mean. I flag this.

zhengchun avatar Aug 18 '20 11:08 zhengchun