从 IE DOM 获取 HTML Head
我知道如何使用 IHTMLDocument2 接口获取文档的 HTML 正文(通过调用 get_body 成员函数)。
但是我如何获取头部?IHTMLDocument2 接口中没有这样的函数?
I know how to obtain the HTML body of a document, using the IHTMLDocument2 interface (by calling the get_body member function.
But how can I get the head? There is no such function in the IHTMLDocument2 interface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此外,您还可以使用
IHTMLDocument2* htmlDocument
代替CComPtrhtml文档
。主要思想是获取文档中的所有元素,迭代它们并找到具有 tagName HEAD 的元素。
希望这有帮助。
Also, you can use
IHTMLDocument2* htmlDocument
instead ofCComPtr<IHTMLDocument2> htmlDocument
.The main idea is to obtain all elements within your document, iterate them and find the one that has the tagName HEAD.
Hope this helps.