T
T
TechNOIR2017-04-05 16:06:38
PowerShell
TechNOIR, 2017-04-05 16:06:38

Powershell. How to assign iFrame to WebBrowser of Forms class?

Good afternoon.
Tricky question for Powershell connoisseurs.
In PS built a form with WebBrowser elements:

Add-Type -AssemblyName System.Windows.Forms
$URL1 = "http://site.com"
# WinForm Setup
$mainForm = New-Object System.Windows.Forms.Form
$mainForm.Font = “Comic Sans MS,9"
$mainForm.ForeColor = [System.Drawing.Color]::White
$mainForm.BackColor = [System.Drawing.Color]::DarkSlateBlue
$mainForm.Text = " System.Windows.Forms.WebBrowser Class"
$mainForm.Width = 960
$mainForm.Height = 750

# Main Browser
$webBrowser1 = New-Object System.Windows.Forms.WebBrowser
$webBrowser1.URL = $URL1
$webBrowser1.Width = 600
$webBrowser1.Height = 600
$webBrowser1.Location = "50, 25"
$mainForm.Controls.Add($webBrowser1)

# First Selectable Browser
$webBrowser2 = New-Object System.Windows.Forms.WebBrowser
$webBrowser2.URL = $URL1
$webBrowser2.Width = 600
$webBrowser2.Height = 50
$webBrowser2.Location = "50, 630"
$mainForm.Controls.Add($webBrowser2)

# Display Form
[void] $mainForm.ShowDialog()

There is a site for example site.com. On it, the entire page consists of two (or more) iFrame.
Required: It is necessary that in the PS script site.com be loaded in such a way that Webbrowser1 has iFrame1, and WebBrowser2, respectively, iFrame2
Is this possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
azarij, 2017-04-05
@TechNOIR

look at the source of the site and find where the addresses for frames are set. then paste these addresses into:
$URL1 =
$webBrowser2.URL =

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question