Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1956|回复: 0

请教如何将用户名和密码填入网页

[复制链接]
发表于 2019-1-10 09:06 | 显示全部楼层 |阅读模式
网页原代码如下
<div id="login-input" class="loginForm">
    <form name="loginform" method="post">
     
     <input type="hidden" id="hostName" name="hostName" value="" />
     <div id="login-input-user" class="loginUser">
      <label style="line-height: 34px">
       用户名
      </label>
      <input id="username" class="loginInput" type=text name="username"
       size="20" value="">
     </div>
     <div id="login-input-password" class="loginPassword">
      <label style="line-height: 34px">
       密 码
      </label>
      <input class="loginInput" type=password id="password"
       name="password" size="20" value="">
     </div>
我写的如下,没填进去不知为何故?
Sub ???()
    On Error Resume Next
    With CreateObject("InternetExplorer.Application")
        .Visible = True
        .Navigate "http://dc.emis.edu.cn/jcjy/mis2/index.jsp"
        Do Until .ReadyState = 4
            DoEvents
        Loop
    i = ActiveCell.Row
    .document.getElementById("login-input-user").Value = Range("b" & i)
   
.document.getElementById("login-input-password").Value = Range("c" & i)
.document.getElementById("loginBtn").Click
      '  .Quit
    End With
End Sub

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-26 22:18 , Processed in 0.269485 second(s), 8 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表