Jump to content
Sign in to follow this  
ygoldshtrakh

_IEBodyReadHTML help Needed

Recommended Posts

ygoldshtrakh

Hi everybody,

I'm trying to add validation to y script however i cannot figure out how _IEBodyReadHTML works and there are not enough example i could find. What i would like to see is something like that

after submit button is clicked

wait for the page to laod

Readhtml

verify that the content of the list box or title of the page or image got there

Is it at all possible?

Thank you

Y.G

Share this post


Link to post
Share on other sites
DaleHohm

Yes, it's possible... the Title is not in the body however, it is in the HEAD section, so you cannot get it with BodyRead... there is another way however.

I have to run at the moment, but unless someone else beats me to an example, I'll enter more in this response later this evening.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
DaleHohm

Here's some sample code using _IEBodyReadHTML() that will hopefully help you.

$oIE = _IECreate()
_IENavigate($oIE, 'http://www.somesite.com')

; _IEBodyReadHTML returns the HTML between <BODY> and </BODY>
;
$s_HTMLbefore = _IEBodyReadHTML($oIE)
; work with your form here - submit, whatever
_IELoadWait($oIE)
$s_HTMLafter = _IEBodyReadHTML($oIE)

; now compare the contents of $s_HTMLbefore and $s_HTMLafter

If you want to get the HTML for the entire document, you can use the following instead:

$s_HTML = $oIE.document.getElementsByTagName("HTML").item(0).outerHTML

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
ygoldshtrakh

Thank you Dale,

is there any simple way to read just what is in the list box?

Once agaiin thanks a ton

Here's some sample code using _IEBodyReadHTML() that will hopefully help you.

$oIE = _IECreate()
_IENavigate($oIE, 'http://www.somesite.com')

; _IEBodyReadHTML returns the HTML between <BODY> and </BODY>
;
$s_HTMLbefore = _IEBodyReadHTML($oIE)
; work with your form here - submit, whatever
_IELoadWait($oIE)
$s_HTMLafter = _IEBodyReadHTML($oIE)

; now compare the contents of $s_HTMLbefore and $s_HTMLafter

If you want to get the HTML for the entire document, you can use the following instead:

$s_HTML = $oIE.document.getElementsByTagName("HTML").item(0).outerHTML

Dale

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×