G___wang 2015-10-28 14:31 采纳率: 0%
浏览 1922

关于 python 的一个自动登录脚本的问题

一个要等5秒之后才可以登录,有onclick() 函数的应该怎么做一个自动登陆的python脚步,哪个大神给我讲一下。万分谢谢。

这是网页源代码片段

function Clicked(){
if(sv1==1)
document.form1.v6ip.value=myv6ip;
if(osele!=1){
if(sv==2&&m46==1)
v4serip=v6;
open("http://"+v4serip+":9002/In0","p99","width=280,height=50,left=0,top=0,toolbar=no,crollbars=no,status=no");
}
var thisform=document.forms[0];
if(thisform.DDDDD.value=="") {
thisform.DDDDD.focus();
alert("请您输入用户帐号");
return false;
} else if(thisform.upass.value=="") {
thisform.upass.focus();
alert("请您输入用户密码");
return false;
} else {
setCookie("myusername",thisform.DDDDD.value,10);
if(thisform.savePWD.checked)
setCookie("pwd",thisform.upass.value,10);
else
setCookie("pwd","",-10);
setCookie("username",thisform.DDDDD.value,10)
setCookie("smartdot",thisform.upass.value,10)
thisform.submit();
}
}

function tologin(){
var thisform=document.forms[0];
if(thisform.DDDDD.value=="") {
thisform.DDDDD.focus();
alert("请您输入用户帐号");
return false;
} else if(thisform.upass.value=="") {
thisform.upass.focus();
alert("请您输入用户密码");
return false;
} else {
setCookie("myusername",thisform.DDDDD.value,10);
if(thisform.savePWD.checked)
setCookie("pwd",thisform.upass.value,10);
else
setCookie("pwd","",-10);
setCookie("username",thisform.DDDDD.value,10)
setCookie("smartdot",thisform.upass.value,10)
return true;
}
}
function setCookie(cookieName,cvalue,expiredays,path){
var expireDate = new Date();
var expireStr = "";
if (expiredays != null) {
expireDate.setTime(expireDate.getTime()+(expiredays*24*3600*1000));
expireStr="; expires="+expireDate.toGMTString();
}
pathStr = (path == null) ? "; path=/" : "; path=" + path;
document.cookie = cookieName + '=' + escape(cvalue) + expireStr + pathStr;
}
function getCookie(cookieName)
{
var index=-1;
if(document.cookie)
index=document.cookie.indexOf(cookieName);
if(index==-1) {
return "";
} else {
var iBegin = (document.cookie.indexOf("=", index) +1);
var iEnd =document.cookie.indexOf(";", index);
if (iEnd == -1)
{
iEnd = document.cookie.length;
}
return unescape(document.cookie.substring(iBegin,iEnd));
}
}
function test1()
{
document.forms[0].DDDDD.value=getCookie('myusername');
var pwd = getCookie('pwd');
if (pwd != ''){
document.forms[0].upass.value = pwd;
document.forms[0].savePWD.checked = true;
}
setFormFocus();
}
function $(id)
{
return document.getElementById(id);
}
var remain =5;
function init(){
$("btn").innerHTML = "请稍等("+(remain--)+"秒)";
if(remain>-1){
window.setTimeout(init,1000);
}
else{
$("btn").disabled = false;
$("btn").innerHTML = "登录 Login";
}
}
function on_load(){
test1();
init();
var ua = window.navigator.userAgent.toLowerCase();
url6='iv6';if (ua.indexOf("firefox")>-1)url6='nv6';
if(sv==1&&sv1==0&&domain!='dr.com')document.getElementById("c").src='http://'+domain+':9002/'+url6;
}
登录 Login

万分感谢

  • 写回答

1条回答 默认 最新

  • JPF1024 2015-10-28 15:02
    关注

    看网页上面的提交地址是什么,然后模拟一个请求提交相关的参数。

    评论

报告相同问题?

悬赏问题

  • ¥15 CSS实现渐隐虚线边框
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题