gpt4 book ai didi

c# - webBrowser 控件在 Ajax 网页更新后或在框架中找不到 htmlElement

转载 作者:太空狗 更新时间:2023-10-29 23:48:43 27 4
gpt4 key购买 nike

在 winForm 中使用 webBrowser 控件。但是当网页通过 Ajax 或框架更新时,我无法使用webBrowser1.document.getElementById 等找到那个htmlElement。该元素也不会显示在 IE 的 View->Source code 中。

最终目的是找到 htmlElement 并模拟点击或其他类似的功能invokeMember("staff").

最佳答案

WebBrowser 的 Document 对象确实代表了 DOM 的实时 View ,因此您可能无法找到它的某些其他原因。然而,DOM 更新将不会在 View -> Source 中显示。您应该使用 IE8 的开发人员工具,它会向您显示 DOM 的实时 View ,您可能会看到诸如不正确/重复 ID 之类的内容。

关于c# - webBrowser 控件在 Ajax 网页更新后或在框架中找不到 htmlElement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2467758/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com