用console实现自动刷新页面和点击的代码(以百度为例)

timeout=1;
total=10;
start=0;
test = “test1″;
current=location.href;
setTimeout(‘reload()’,1000*timeout);
function reload(){
start++;
test+=”1″;
if(start >= total) return;
setTimeout(‘reload()’,1000*timeout);
$(‘#kw’).val(test);
$(‘.btn.self-btn’).click();
fr4me='<frameset cols=\’*\’>\n<frame src=\”+current+’\’/>’;
fr4me+='</frameset>’;
with(document){write(fr4me);void(close())};
}