python win32api 如何用代码模拟点击网页confirm框的确定按钮

mshtml.IHTMLDocument2 doc = (mshtml.IHTMLDocument2)webBrowser1.Document.DomDocument;
doc.parentWindow.execScript("function confirm(str){return true}", "javascript");

参考:

https://bbs.csdn.net/topics/350058931

原文地址:https://www.cnblogs.com/sea-stream/p/10422385.html