【问题标题】:ExecuteScriptAsync("document.GetElementsById('userId-input').outerHTML;;") returns nullExecuteScriptAsync("document.GetElementsById('userId-input').outerHTML;;") 返回 null
【发布时间】:2021-03-15 23:26:09
【问题描述】:

我能够做到以下几点: (在 NavigationCompletedAsync 处理程序中)

```
string0 = ExecuteScriptAsync("document.documentElement.outerHTML;");
Regex.Unescape(string0)
string0.Remove(0, 1);
string0.Remove(string0.Length - 1, 1);
```

我可以在编辑器中看到 html 页面。 id 为“userId-input”的

但是,当我这样做时: ExecuteScriptAsync("document.GetElementsById('userId-input').outerHTML;");

结果为“空”

在两次调用之间插入 5 秒延迟没有帮助。

感谢任何输入。 谢谢!

【问题讨论】:

    标签: webview2


    【解决方案1】:

    请考虑关闭。 我有两个拼写错误: GetElementsById 应该是: getElementById

    现在一切正常。

    【讨论】:

      猜你喜欢
      • 2016-09-20
      • 2021-05-04
      • 2014-11-09
      • 1970-01-01
      • 2020-01-23
      • 2022-01-27
      • 1970-01-01
      • 2016-01-25
      • 1970-01-01
      相关资源
      最近更新 更多