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

标签 webview2

我将一种可运行的 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/

相关文章:

delphi - Microsoft.WebView2 和 Edge

vba - 我如何在 VBA 中调用 WebView2 和其他现代 winmd 功能

c# - WebView2如何运行Javascript函数?

.net-core - 绕过 WebView2 中显示的 Kestrel 服务器的无效 SSL 证书

c# - 如何检测 webview2 中的鼠标点击(c#/vb.net)

.net - 检测客户端机器上是否安装了 WebView2 (VB.NET)

c# - WinUI3下如何给Webview2添加环境参数?

wpf - 如何将 Microsoft Edge WebView2 Runtime 添加为先决条件

clickonce - MSIX 添加类似于 ClickOnce 的先决条件