Re: [fakeapp] why does this xpath query not work?

168 views
Skip to first unread message

Todd Ditchendorf

unread,
May 17, 2013, 3:26:16 PM5/17/13
to Fake
Fake simply uses WebKit's ObjC XPath api (it's the same one that is exposed to JS: https://developer.mozilla.org/en-US/docs/Introduction_to_using_XPath_in_JavaScript).

Congrats, you've found a bug in WebKit's XPath implementation! Looks like XPath expressions involving `td` elements just don't work.

I've explained the bug here:


Honestly, I don't know what I will do about this yet...

TD


On Fri, May 17, 2013 at 4:35 AM, <jbo...@googlemail.com> wrote:
i am trying to write the value of a html element into a FAKE variable using this xpath query

//td[text()='Umsatz']/following-sibling::td/text()

while the above query works in python, php and in a xpath firefox extension, it fails in FAKE.

I double checked with a very simple //title/text() xpath query.. that actually works.

any suggestions? what could be the reason?

I bought the software yesterday and loved it at first. but now after spending some time with it it seems quite buggy.




--
You received this message because you are subscribed to the Google Groups "Fake" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fakeapp+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Todd Ditchendorf

unread,
May 17, 2013, 3:58:49 PM5/17/13
to Fake
Related to this issue, I would generally recommend using an XPath like this instead of the example you provided:

string(//td[normalize-space(string(.))='foo']/following-sibling::td)

This will not solve the WebKit bug I mentioned, but it will be a more reliable way to find the nodes and string values you are looking for (use of the `text()` node test can often/easily fail if the browser has not normalized/concatenated all text nodes -- which it is definitely not required to do).

TD

Reply all
Reply to author
Forward
0 new messages