I am trying to search the DOMDocument for a webpage (Wikipedia). I have subclassed WebView and have obtained a DOMDocument object by using: Code: [[self mainFrame] DOMDocument] However, I am unable to search the DOM tree. In particular, the code: Code: [[[[self mainFrame] DOMDocument] childNodes] length] returns 1, which is not the number of nodes I am expecting. Searching that child node: Code: [[[[self mainFrame] DOMDocument] childNodes] item:0] brings me to a dead end immediately. Similar code inserted in the XCode example DOMTreeView returns 2. Why the discrepancy?