Let me just preface this by saying: this was not a super important test case, just a learning excersize. My goal was to find the first non italicized, non spanning link on the page. Sometimes this link occurs in the first paragraph, sometimes in the second paragraph, sometimes in a List Item tag.
Consider the page:
http://en.wikipedia.org/wiki/ProblemIf you used the code provided by smart bear you not be able to get the desired link, which is "Mathematical Problem". The link is in the first list item after the first paragraph.
My solution origionally was a big, long XPATH expression that found all of the links on the page and decided which one to click but this is extremely slow, especially on large pages (like Germany's page). My solution then was to get all of the paragraphs and listItems with substantial text in them by findallchildren on textNode, then use xpath on each individual textNode element to see if it has what we needed. I greatly simplified my code for this posting, but this method was much faster.
SmartBear support: this is not what I was trying to do at all. Also, the textNode elements DO HAVE children. In my OP, if you change the array's index to evaluateXPath on the second paragraph you will see it finds the links there perfectly okay! You can see the children in the debugger! Why does the first paragraph, and only the first one, give you this strange error? That is the question.