[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
贴上代码…
验证码你打算如何解决?
  1. url = "http://yu2n.sinaapp.com"  ' 要采集的网址
  2. Set objIE = CreateObject("InternetExplorer.Application")
  3. With objIE
  4.   ' Configure the IE window
  5.   .RegisterAsDropTarget = False
  6.   .statusbar = False : .toolbar  = False : .menubar   = False : .addressbar = False
  7.   .Resizable = False : .Visible = True : .Navigate(URL)
  8.   Do While .Busy Or .ReadyState <> 4 : WScript.Sleep 200 : Loop  ' 等待完全载入
  9.   .width = 600     : .height = 400   ' 宽度与高度
  10.   .left = .document.parentWindow.screen.width \ 2 - 300  ' 居中显示
  11.   .top  = .document.parentWindow.screen.height\ 2 - 200
  12.   ' Test for IE 7 - cannot remove 'chrome' in that version
  13.   nVersion  = CSng(replace(split(_
  14.           .document.parentWindow.navigator.appVersion, " ")(3)_
  15.           , ";", ""))
  16.   if nVersion < 7.0 Then .FullScreen = True
  17.   ' Create the body document
  18.   With .document
  19.   
  20.     .getElementById("corpVccId").focus()
  21.     .getElementById("corpVccId").value = "123456"
  22.     .getElementById("user_name").focus()
  23.     .getElementById("user_name").value = "yu2n"
  24.     .getElementById("password").focus()
  25.     .getElementById("password").value = "yu2n"
  26.     .getElementById("cin_verifyCode").focus()
  27.     .getElementById("cin_verifyCode").value = InputBox("请输入验证码:", WScript.ScriptName, "yu2n")
  28.     .getElementById("corpVccId").disabled = True
  29.     .getElementById("user_name").disabled = True
  30.     .getElementById("password").disabled = True
  31.     .getElementById("cin_verifyCode").disabled = True
  32.    
  33.     WScript.Sleep 1000
  34.    
  35. REM 登陆按钮1
  36.     REM .getElementById("Button").focus()
  37.     REM .getElementById("Button").click()
  38.     REM 登陆按钮2
  39.     REM .getElementsBytagname("form1").submit
  40.     REM .forms(0).submit
  41.    
  42.     Do While objIE.Busy Or objIE.ReadyState <> 4 : WScript.Sleep 200 : Loop  ' 等待完全载入
  43.     .getElementById("Button").disabled = True
  44.     sHtml = .body.innerHTML  ' 将结果赋值给变量 str,以HTML格式返回数据
  45.    
  46.   End With
  47.   
  48.   WScript.Sleep 1000
  49.   .Visible = False
  50.   .quit
  51. End With
复制代码
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

返回列表