我试图使用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?
谢谢!
答案 0 :(得分:0)
尝试使用NewWindow3
event,以便在创建对象时抓取该对象。
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)