Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ie = New-Object -ComObject "InternetExplorer.Application"
- $ie.navigate("http://example.local")
- while($ie.ReadyState -ne 4) { Start-Sleep -Seconds 5 }
- $ie.visible = $true
- $doc = $ie.document
- $userField = $doc.getElementById("uid")
- $passwordField = $doc.getElementById("pwd")
- $submitButton = $doc.getElementById("submit")
- $userField.value = "userid"
- $passwordField.value = "*****"
- $submitButton.click()
- $shell = New-object -ComObject "Shell.Application"
- # The app opens a new window with a timestamp - that's the window I want, so I skip the other window
- $ie2 = $shell.Windows() | where {$_.Type -eq "HTML Document" -and $_.LocationName -ne "My App - Parent Window"}
- $doc2 = $ie2.document
- $frames = @($doc2.getElementsByTagName("FRAME"))
- Write-Host $frames.Count # shows "3"
- Write-Host $frames[1].Title # shows "Left Nav"
- <frameset rows="60,*">
- <frame src="http://example.local/really/long?url" title="Top Nav" name="Top" id="Top">
- <frameset cols="175,*">
- <frame src="http://example.local/left.html" title="Left Nav" name="Left" id="Left">
- <frame src="http://example.local/main.html" title="Main Display" name="Main" id="Main">
- </frameset>
- </frameset>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement