Sign in to follow this  
Followers 0
derekwrobel

_IECreate not returning complete page?

5 posts in this topic

I'm struggling with a page that is fairly large and has many frames. I was trying to first grab the page, and the wanted to get the frame by name/id. It was failing so I was troubleshooting and found that the $oIE variable I was storing the IE object in isn't the complete page. Here's what I am doing:

$oIE = _IECreate ("http://google.com")

_IENavigate($oIE, "https://<our website>.com", 0)

sleep(2000)

$sText = _IEDocReadHTML($oIE)

filewrite("C:\Results\script_html.txt, $sText)

When looking at the script_html.txt file generated, this is not the entire page html listed. I assume this is why I cannot find the iFrame later down in my code. Is there some limitation to the IE.au3 that it cannot handle large web pages?

Share this post


Link to post
Share on other sites



Absolutely not. You are probably being fooled by your frames. Try using a DOM inspector, like DebugBar (see my sig).

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

#3 ·  Posted (edited)

Thanks for the tool, I also have used Developer Tools (F12) which seems similar but great to have a few in case one has some advantages over the other.

For the 'being fooled by frames', I'm a bit confused. I do realize that the frame I want is quite deep (form in an iframe, in an iframe, in a form). But to even grab the contents of the iframe I want to reference, doesn't the original IE object have to contain the entire page? Otherwise, how can you grab the iFrame you want from it? Maybe I am not understanding what the object returned by _IECreate or _IENavigate contains. I expected the entire page.

When I navigate to a page, are you saying I need to specify a specific frame on load time?

Edited by derekwrobel

Share this post


Link to post
Share on other sites

I should also explain what the purpose of my script is. Basically I want to automate a script that takes a parameter (server name) that will continually sign in/out of our web app on a load balancer until it hits the server name specified. At the bottom of the page once logged in, it will show you which server you routed to.

At that point the script stops so a user can now start using the application. So navigating to a specific frame containing this 'server name' is not an option as the page will not be useful once the script stops. The user needs the entire page loaded to continue using it.

Is this something I can do using the IE.au3 library? If so, how can I go about doing this? It's really sad because all I need to do is very the text string on the page but cannot seem to find an easy way to locate the text.

Share this post


Link to post
Share on other sites

A document contains a reference to a frame, but not the frame source. You will find hundreds of example in this forum of people drilling into embedded frames to get what they are looking for.

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

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  
Followers 0