string s = "var _elm = document.getElementById('loginBtn');var _evt = document.createEvent('MouseEvents');_evt.initEvent('click', true, true);_elm.dispatchEvent(_evt);"; browser.StringByEvaluatingJavaScriptFromString(s); 本文转自黄聪博客园博客,原文链接:http://www.cnblogs.com/huangcong/p/5135713.html,如需转载请自行联系原作者