gpt4 book ai didi

WebView2 (2020/06) -> DOM 在哪里?

转载 作者:行者123 更新时间:2023-12-04 12:58:40 24 4
gpt4 key购买 nike

我将一种可运行的 Excel VBA 应用程序移动到 C#/Windows Forms/WebView2项目。

目前,似乎没有基础知识。

例如...

    1- if(browser.navigationComplete == true){

That simple check isn't available.
How is one supposed to flow sequences of user actions without this?

2- htmlagilitypack like tools?

In VBA you can easily work with the DOM since there's types for pretty much everything. Where's that in WebView2?

也许我弄错了,但看起来 webview2 只是一个浏览器,没有 VBA 二十多年来拥有的自动化工具。请告诉我,我不必爬回我中世纪的 Excel VBA 地牢。我看到了光,很好!

任何架构或实际测试的工作代码将不胜感激:)

谢谢你来自温哥华,

安托万

最佳答案

1. browser.navigationComplete :您应该可以使用 WebView2.NavigationCompleted事件。

2. htmlagilitypack :虽然 WebView2 不提供直接 DOM 访问,但您可以获得 html as a string并使用 htmlagilitypack LoadHtml功能。还有 htmlagilitypack from web功能,但我不确定这是否只是在幕后使用 WebBrowser。

关于WebView2 (2020/06) -> DOM 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62328943/

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