INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Is it possible to get HTML code with powershell ?

Is it possible to get HTML code with powershell ?

(OP)
Hello

Is it possible to get HTML code of a webpage with powershell and save code to TXT file ?

Best Regards
L.

RE: Is it possible to get HTML code with powershell ?

(OP)
Hello

I'm trying to read frame content in powershell:

CODE

$ie = New-Object -com InternetExplorer.Application
$ie.visible = $true
$ie.navigate2("http://lala/perion/browse")
while($ie.busy) {start-sleep 3}
($ie.Document.getElementsByTagName("input") | ? {$_.name -eq 'user'}).Value = 'lala'
($ie.Document.getElementsByTagName("input") | ? {$_.name -eq 'pass'}).Value = 'lala'
($ie.Document.getElementsByTagName("input") | ? {$_.type -eq 'submit'}).click()
$ie.Document.documentElement.all | d:\test\wd.txt 

Steps:
1. new object
2. IE is visible
3. navigate to website
4. sleep because IE is opening
5. enter username
6. enter password
7. click "SUBMIT"
8. show all elements in CODE and write to filr

now I need contect of this frame
This red frame...

in step 8 I have in file all elements

and I know that frame is under

src : /Hyperion/browse/browseList?

Quote:


tagName : FRAME
parentElement : System.__ComObject
style : System.__ComObject
onhelp :
onclick :
ondblclick :
onkeydown :
onkeyup :
onkeypress :
onmouseout :
onmouseover :
onmousemove :
onmousedown :
onmouseup :
document : System.__ComObject
title : Contenu
language :
onselectstart :
sourceIndex : 14
recordNumber :
lang :
offsetLeft : 144
offsetTop : 0
offsetWidth : 1292
offsetHeight : 650
offsetParent : System.__ComObject
innerHTML :
innerText :
outerHTML : <FRAME title=Contenu marginHeight=0 src="/Hyperion/browse/browseList?" name=data marginWidth=0>
outerText :
parentTextEdit :
isTextEdit : False
filters :
ondragstart :
onbeforeupdate :
onafterupdate :
onerrorupdate :
onrowexit :
onrowenter :
ondatasetchanged :
ondataavailable :
ondatasetcomplete :
onfilterchange :
children : System.__ComObject
all : System.__ComObject
scopeName : HTML
onlosecapture :
onscroll :
ondrag :
ondragend :
ondragenter :
ondragover :
ondragleave :
ondrop :
onbeforecut :
oncut :
onbeforecopy :
oncopy :
onbeforepaste :
onpaste :
currentStyle : System.__ComObject
onpropertychange :
tabIndex : -32768
accessKey :
onblur :
onfocus :
onresize :
clientHeight : 650
clientWidth : 1292
clientTop : 0
clientLeft : 0
readyState : complete
onreadystatechange :
onrowsdelete :
onrowsinserted :
oncellchange :
dir :
scrollHeight : 650
scrollWidth : 1292
scrollTop : 0
scrollLeft : 0
oncontextmenu :
canHaveChildren : False
runtimeStyle : System.__ComObject
behaviorUrns : System.__ComObject
tagUrn :
onbeforeeditfocus :
readyStateValue :
isMultiLine : True
canHaveHTML : False
onlayoutcomplete :
onpage :
inflateBlock :
onbeforedeactivate :
contentEditable : inherit
isContentEditable : False
hideFocus : False
disabled : False
isDisabled : False
onmove :
oncontrolselect :
onresizestart :
onresizeend :
onmovestart :
onmoveend :
onmouseenter :
onmouseleave :
onactivate :
ondeactivate :
glyphMode :
onmousewheel :
onbeforeactivate :
onfocusin :
onfocusout :
uniqueNumber : 26
uniqueID : ms__id26
nodeType : 1
parentNode : System.__ComObject
childNodes : System.__ComObject
attributes : System.__ComObject
nodeName : FRAME
nodeValue :
firstChild :
lastChild :
previousSibling : System.__ComObject
nextSibling :
ownerDocument : System.__ComObject
dataFld :
dataSrc :
dataFormatAs :
role :
ariaBusy :
ariaChecked :
ariaDisabled :
ariaExpanded :
ariaHaspopup :
ariaHidden :
ariaInvalid :
ariaMultiselectable :
ariaPressed :
ariaReadonly :
ariaRequired :
ariaSecret :
ariaSelected :
ie8_attributes :
ariaValuenow :
ariaPosinset :
ariaSetsize :
ariaLevel :
ariaValuemin :
ariaValuemax :
ariaControls :
ariaDescribedby :
ariaFlowto :
ariaLabelledby :
ariaActivedescendant :
ariaOwns :
ariaLive :
ariaRelevant :
constructor :
src : /Hyperion/browse/browseList?
name : data
border :
frameBorder :
frameSpacing :
marginWidth : 0
marginHeight : 0
noResize : False
scrolling : auto
contentWindow :
onload :
allowTransparency : False
longDesc :
borderColor :
height : 650
width : 1292
contentDocument :
ie8_src :
ie8_longDesc :
ie8_frameBorder :


So how to enter DEEPER and enter this frame and get code for this frame ?

Best Regards
L


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close