【问题标题】:Open a web page and click a button in VB script打开网页并单击 VB 脚本中的按钮
【发布时间】:2012-01-28 02:28:13
【问题描述】:

我想在 Internet Explorer 中打开一个网页并导航到一个页面,然后使用 单击该页面中的一个按钮。 例如

  • 我想打开 IE 并导航到“http://www.gmail.com”,
  • 等待页面加载,
  • 并在用户名和密码文本框中填写用户名和密码,然后使用 VB 脚本点击登录按钮。

这是我唯一能找到的(只能在 IE 中打开页面):

Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("iexplore.exe www.gmail.com", 1) 

请帮帮我。

【问题讨论】:

标签: vbscript scripting vbscript


【解决方案1】:

类似:

 Set IE = CreateObject("InternetExplorer.Application") 
 Set WshShell = WScript.CreateObject("WScript.Shell") 
 IE.Navigate "http://mydomain.com/form.asp" 
 IE.Visible = True 
 Wscript.Sleep 2000 
 IE.Document.All.Item("Item1Id").Value = "1000" 
 IE.Document.All.Item("Item2Id").Value = "1001" 
 IE.Document.All.Item("Item3Id").Value = "Some Text" 
 Call IE.Document.Forms(0).Submit()

【讨论】:

  • 但我无法进一步导航此代码..它打开了一个网页,在文本框中输入了值,单击了提交按钮并登陆了另一个页面。但我试着更进一步。 .我试图从我登陆的屏幕导航到另一个页面但输入一些值并单击提交按钮..但我不能..
  • 我试过这样 Set IE = CreateObject("InternetExplorer.Application") Set WshShell = WScript.CreateObject("WScript.Shell") IE.Navigate "google.co.in" IE.Visible = True Wscript .Sleep 2000 IE.Document.All.Item("lst-ib").Value = "something" 调用 IE.Document.Forms(0).Submit() Wscript.Sleep 2000 IE.Document.All.Item("lst -ib").Value = "1001" 这里"lst-ib"是搜索文本框的id
猜你喜欢
  • 1970-01-01
  • 2014-06-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多