1

我正在尝试使用 powershell 来自动化和解析网站。一切正常,直到我“单击”链接并在新窗口中打开。如何访问该窗口以便解析它?

$ie = New-Object -com Internetexplorer.application 
$ie.Visible= $true
$ie.Navigate("http:/.....")
....
# find a link... 
$link.click(); # a new popup window open up.
# how can I get access to the new popup window?

谢谢!

4

1 回答 1

0

尝试使用该NewWindow3事件,以便您可以在创建对象时抓取它。

Raised when a new window is to be created. Extends NewWindow2 with additional information about the new window.
Syntax
        Private Sub object_NewWindow3( _
    ByRef ppDisp As Object, _
    ByRef Cancel As Boolean, _
    ByVal dwFlags As Long, _
    ByVal bstrUrlContext As String, _
    ByVal bstrUrl As String)
于 2015-10-22T02:01:20.290 回答