问题标签 [playwright-dotnet]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
761 浏览

c# - 剧作家“元素未附加到 DOM”

我正在尝试使用 Playwright (.NET) 抓取网站。该网站看起来像是在 2000 年代初编写的(以怪癖模式运行),我遇到了一个我似乎无法找到解决方案的问题。

我的目标是选中一个复选框。我可以input使用选择元素

该元素已成功选择,但是在尝试运行时await input.CheckAsync(),出现错误Element is not attached to the DOM。我没有注意到会导致这种情况的元素有任何异常。为什么会发生此错误?

更新

我通过运行await page.ClickAsync("inputSelector")以选中该框使其工作。这适用于我的目的,但它不能解释为什么如果以其他方式执行它会出错,所以我仍然想知道为什么会发生该错误。

0 投票
0 回答
21 浏览

c# - Microsoft.Playwright.PlaywrightException:连接月球时无法使用 Playwright C# 验证第一个证书

尝试使用以下代码连接月球。有人可以帮我吗? Microsoft.Playwright.PlaywrightException: unable to verify the first certificate Using Playwright

轨迹追踪:

代码: