Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我使用此代码时
<code> webKitBrowser1.StringByEvaluatingJavaScriptFromString("Document.GetElementById('id').InvokeMember('click')"); </code>
我收到此消息错误
“对 COM 组件的调用已返回错误 HRESULT E_FAIL。”
对C#不太了解,但看起来调用是错误的。您正在尝试评估 javascript,因此调用应如下所示
document.getElementById('id').click();
请注意,这种情况也很重要——至少在 webkitgtk 版本中。Document 和 document 确实指向两个不同的实体。