⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htmlelem.vbs

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 VBS
字号:
'htmlelem.vbs
 'lists all elements in document specified by command line argument
 Dim objIE, objDoc

 If WScript.Arguments.Count <> 1 Then
   WScript.StdErr.WriteLine "You must specify a URL to process"
   WScript.Quit
 End If

 'create an instance of the IE browser
 Set objIE = CreateObject("InternetExplorer.Application")
 
 'go to the page
 objIE.Navigate Wscript.Arguments(0)

 'wait to load page
 While objIE.Busy : Wend

 Set objDoc = objIE.Document.All

 'loop through all elements in the HTML document
 For Each objItem In objDOC

 'check if the element is an input element (input box, check box etc.)
  If TypeName(objItem) = "HTMLInputElement" Then 
    Wscript.Echo objItem.value, objItem.name, objItem.type
  Else
    Wscript.Echo TypeName(objItem) 'just output the HTML object type 
  End If
 Next 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -