Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Accessing DOM in frames

$
0
0

Dear All,

I have a script which allows me to login automatically on a page in internet.

 

$FormInInternet="my.form.index.html"

$ie=New-Object -comobject InternetExplorer.Application
$ie.visible=$true
$ie.Navigate( $FormInInternet )
$doc = $ie.document

$ie.Document.getElementById("username").value="user"
$ie.Document.getElementById("password").value="pass"

Now I want make my own html document using a frame. The upper one is the internet web site I want to login, the other one below holds some useful information to facilitate browsing. I therefore have a frameset of following atructure:

<frameset rows='85%,*' bordercolor='#000000'>
<frame src='https://my.form.index.html' name='oben' marginwidth='0' marginheight='0' scrolling='auto' noresize>
<frame src='./hints.htm' name='main' marginwidth='0' marginheight='0' scrolling='auto' noresize>
 
</frameset>

$frms = @($ie.document.getElementsByTagName("FRAME"))
$frms[0].getElementById("username")

the last lne does not work any more.

Can anyone give me an idea what is happening and how to work around ?

Maybe is has something to do with security aspects, since I have combined different domains ?

Thx a lot

Erych


Viewing all articles
Browse latest Browse all 6937

Trending Articles