2

TWebBrowser应用程序中,我想使用 Delphi 2006 (!) 获取指向包含此元素的元素的指针

<input class="submit" type="submit" value="&nbsp;Vis veibeskrivelse&nbsp;" onclick="showDirections();" />
<a href="#" onclick="openDirections(); return false;">&Aring;pne veibeskrivelse i Google Maps</a>
<br />

我发现IHTMLDocument7实现 a getElementsByClassName,但在 Delphi 2006 中,IHTMLDocument7未实现。

还有其他方法可以获取指向该元素的指针吗?

4

1 回答 1

1

You can define the IHTMLDocument7 interface manually in your code, it is just an interface declaration. Delphi does not actually implement the interface, the web browser does.

Otherwise, since the element does not have a name, you can loop through the IHTMLDocument.all collection one element at a time, querying the className property of each element until you find what you are looking for.

于 2012-11-01T18:31:24.103 回答