码迷,mamicode.com
首页 > Web开发 > 详细

VBS操作JS网页元素实例

时间:2014-08-15 01:28:26      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:os   io   for   ar   2014   log   ad   res   

‘==========================================================================

‘ VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.0

‘ NAME:

‘ AUTHOR: Microsoft , Microsoft
‘ DATE : 2014/8/14

‘ COMMENT:

‘==========================================================================

dim Ie,obj
set Ie =wscript.createobject("internetexplorer.application")
ie.navigate "www.baidu.com"
wscript.sleep 1000
ie.menubar=1 ‘ÏÔʾIE¶ÔÏó²Ëµ¥À¸
ie.AddressBar=1 ‘ÏÔʾIE¶ÔÏóµØÖ·À¸
ie.ToolBar=1 ‘ÏÔʾIE¶ÔÏ󹤾ßÀ¸
ie.StatusBar=0 ‘²»ÏÔʾIE¶ÔÏó״̬À¸
ie.FullScreen=0 ‘È«ÆÁ»¯IE¶ÔÏó
ie.Resizable=0 ‘ÉèÖÃIE¶ÔÏó´óСÊÇ·ñ¿ÉÒÔ±»¸Ä¶¯
ie.visible=1 ‘ÉèÖÃÊÇ·ñ¿É¼û


set obj = ie.document

for i=0 to obj.all.length-1

If obj.all(i).tagname="INPUT" Then
If obj.all(i).value="°Ù¶ÈÒ»ÏÂ" Then
WScript.Sleep 1000
obj.all(i).click
End If

End If

Next


Set obj=Nothing

 


‘================================================


‘ x=ie.document.getElementsByTagName("form")
‘ WScript.Sleep 1000
‘ x.submit
‘=======================================================


‘ wscript.sleep 1000
‘ set obj = ie.document

‘ ‘‘‘‘‘‘‘‘‘Ä¿µÄ:²âÊÔ µÇ¼°´Å¥‘‘‘‘
‘ For i=0 to obj.all.length-1
‘ If obj.all(i).tagname="input" Then
‘ if obj.all(i).value="°Ù¶ÈÒ»ÏÂ" Then
‘ WScript.Sleep 1000
‘ obj.all(i).click
‘ end If
‘ End if
‘ Next

VBS操作JS网页元素实例,布布扣,bubuko.com

VBS操作JS网页元素实例

标签:os   io   for   ar   2014   log   ad   res   

原文地址:http://www.cnblogs.com/jinjiangongzuoshi/p/3913757.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!