110,538
社区成员
发帖
与我相关
我的任务
分享
webBrowser1.Document.GetElementById("username").SetAttribute("value", "aaabbb");
webBrowser1.Document.GetElementById("password").SetAttribute("value", "123456");
webBrowser1.Document.GetElementById("submit").InvokeMember("click");
进行自动注册。可以进入到一个弹出页面,里面有一个协议和 同意,不同意 两个按钮,20秒后,同意按钮才激活,可以点击。
我现在就想模拟去点击这个同意按钮。
但这好像是个弹出页面,我不知道在哪能进行处理?
附:弹出页面的源码如下:
<script src="js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function do_agree()
{
window.parent.document.getElementById('isagree').value = '1';
window.parent.window.jBox.close();
}
var sec = 20;
var tm = setInterval(function()
{
if(sec<=0)
{
clearTimeout(tm);
$("#btn_agree1").hide();
$("#btn_agree2").show();
}
else
{
sec--;
$("#btn_agree1").val('我同意(' + sec + ')');
}
}, 1000);
</script>
<div style="margin:10px;">
<div style="overflow-y: scroll; height:400px;">
<p>1、xxx</p> </div>
<p style="text-align:center;">
<input type="button" value="我同意(20)" id='btn_agree1' disabled style="padding: 5px;" />
<input type="button" value="我同意" id='btn_agree2' style="padding: 5px; display:none;" onclick="do_agree();" />
<input type="button" value="我不同意" id='btn_notagree' style="padding: 5px;" onclick="window.parent.window.location='index.php?action=reg';" />
</p>
</div>