如何使用Windows(XP)批处理脚本使用用户名和密码登录网站

rav*_*hok 4 command-line windows-xp batch-file

我能够使用批处理文件连接网站,但我不知道如何在其中插入用户名和密码,当然还有点击提交按钮.

此外,我想知道如何使用Windows批处理脚本单击站点上的可用按钮(例如,在xls选项中导出).

提前致谢.

Mat*_*son 7

随着批处理我想不出办法.使用VBScript,很容易.创建一个新的文本文件并将其命名为AutomateIE.vbs并添加以下代码.双击它以运行它.

Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://TheWebsite"
IE.Visible = True

While IE.Busy
    WScript.Sleep 50
Wend

Set ipf = IE.document.all.username
ipf.Value = "Username" 
Set ipf = IE.document.all.password
ipf.Value = "Password" 
Set ipf = IE.document.all.Submit
ipf.Click 
IE.Quit
Run Code Online (Sandbox Code Playgroud)

确保用户名和密码是网站中定义的实际名称,否则将无效.把它们变成应该的样子.如果您发布URL,我可以验证它们.