Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Internet explorer 如何使用VBS在新IE选项卡中打开URL?_Internet Explorer_Google Chrome_Vbscript - Fatal编程技术网

Internet explorer 如何使用VBS在新IE选项卡中打开URL?

Internet explorer 如何使用VBS在新IE选项卡中打开URL?,internet-explorer,google-chrome,vbscript,Internet Explorer,Google Chrome,Vbscript,我想使用VBS打开许多URL,需要直接输入登录凭据。PFB我的代码: WScript.Quit Main Function Main Set IE = WScript.CreateObject("InternetExplorer.Application") IE.Visible = True IE.Navigate "https://accounts.google.com/ServiceLogin?hl=en&continue=htt

我想使用VBS打开许多URL,需要直接输入登录凭据。PFB我的代码:

    WScript.Quit Main

    Function Main
      Set IE = WScript.CreateObject("InternetExplorer.Application")
      IE.Visible = True
      IE.Navigate "https://accounts.google.com/ServiceLogin?hl=en&continue=https://www.google.co.in/%3Fgws_rd%3Dcr%26ei%3DoSiwUqWmO8LvkQXGhIGoBg"
      Wait IE
      With IE.Document
        .get

ElementByID("Email").value = "xyz@gmail.com"
    .getElementByID("Passwd").value = "123"
  End With
  IE.Navigate "https://accounts.google.com/ServiceLogin?hl=en&continue=https://www.google.co.in/%3Fgws_rd%3Dcr%26ei%3DoSiwUqWmO8LvkQXGhIGoBg"
  Wait IE
  With IE.Document
    .getElementByID("Email").value = "abc@gmail.com"
    .getElementByID("Passwd").value = "12345"
  End With
End Function

Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy 
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy 
End Sub

Sub IE_OnQuit
  On Error Resume Next
  WScript.StdErr.WriteLine "IE closed before script finished."
  WScript.Quit
End Sub
如果有人能为我澄清以下疑问,我将不胜感激:

如何确保此链接在同一窗口中但在不同选项卡中打开? 我尝试了一些方法,但无法编写这样的代码,即通过代码单击登录按钮。有办法吗? 我在一些地方读到VBS不适用于Chrome。但坦率地说,IE使用起来不是很方便。那么,有没有什么方法可以让我在Chrome中获得类似的结果呢? 第一次尝试VBS,所以我可能会觉得有点幼稚! 请忍受! :

提前谢谢! :