【发布时间】:2017-11-08 22:22:44
【问题描述】:
我的内置浏览器下载了一个页面。
在此页面的“body”下,有一个“iframe”标签。
在这个 iframe 内部,还有另一个代码(div 标签、表格等)。
但我不知道如何访问它们。
webBrowser1.Document.GetElementById("myiFrame").innerHTML // gives out empty result as if there is nothing there.
webBrowser1.Document.GetElementById("myiFrame").FirstChild.innerHTML // gives an error as if there is no first child.
webBrowser1.Document.GetElementById("mylink") // error as if it doesn't exist
webBrowser1.Document.GetElementsByTagName("a")[2] // error as if it doesn't eist
我没有选择。
我需要点击这个框架深处的一个东西:
body -> div -> div -> div -> form -> div -> div -> div -> div -> div -> div -> div -> div -> table -> tbody -> tr -> td -> a
【问题讨论】:
-
当您说“GetElementsByTagName”不起作用时 - 您的意思是 document.GetElementsByTagName 不起作用?因为如果你做整个文档,它应该会找到它。
标签: c# html browser webbrowser-control