怎么获取百度登录页面的登录按钮

fieldset{padding:10px;}

如何获取百度登录页面的登录按钮这几天看huangyang0613一直在写自动登录的vba,自己也心痒,于是就学习自动登录百度的页面.这是代码VB code

Option ExplicitPrivate Sub Command1_Click()ie.Navigate "https://passport.baidu.com/?login&tpl=mn"  DoEvents  While ie.Busy  DoEvents  WendEnd SubPrivate Sub Command2_Click()ie.Document.All("username").Value = "123"ie.Document.All("normModPsp").Value = "123"ie.Document.All("mem_pass").Checked = UncheckedDim aAllDim aSet aAll = ie.Document.allFor Each a In aAll    If a.Value = "登陆" Then a.ClickNextEnd SubPrivate Sub Form_Load()ie.Navigate "about:blank"End Sub

错误出现在 If a.Value = "登陆" Then a.Click,对象不支持该属性或方法其他的都行就是在登录按钮的获取时获取不到这是百度登录页面https://passport.baidu.com/?login&tpl=mn这是按钮行的源文件.HTML code

 <tr>                             <td >&nbsp;</td>                            <td> <input type="submit" value=" 登录 "/>&nbsp;&nbsp;<a href="https://passport.baidu.com/?getpass_index">忘记密码?</a></td>                     </tr>

——解决方案——————————————————–VB code

Private Sub Command1_Click()WebBrowser1.Navigate "https://passport.baidu.com/?login&tpl=mn"End SubPrivate Sub Command2_Click()WebBrowser1.Document.All("username").Value = "123"WebBrowser1.Document.All("normModPsp").Value = "123"WebBrowser1.Document.All("mem_pass").Checked = UncheckedWebBrowser1.Document.Forms(0).submitEnd SubPrivate Sub Form_Load()WebBrowser1.Navigate "about:blank"End Sub------解决方案--------------------------------------------------------submit是一个功能click click是按钮点击 submit 是窗体提交 顺序应该是按钮点击之后窗体执行提交所以要想CLICK必须要有按钮的ID------解决方案--------------------------------------------------------登录 登录 登录 登录 登录 登录 登录 登录 不是登陆人之所以有一张嘴,而有两只耳朵,原因是听的要比说的多一倍。

怎么获取百度登录页面的登录按钮

相关文章:

你感兴趣的文章:

标签云: