Sign in to follow this  
Followers 0
eEniquEe

How to load a page directly from source instead of using _IENavigate function?

9 posts in this topic

#1 ·  Posted (edited)

Hi again everyone,

I'm having some little problem here. I can obtain the source of a page by using _InetGetSource. And I have also Embed IE window in my GUI. I just wonder if there's actually a way to tell IE to build a page from the source I have? I may use _IENavigate, but it would just downloaded everything twice which makes it brandwidth consuming for the server.

I have tried to use both _IEBodyWriteHTML, and _IEDocWriteHTML; then use _IEAction($oIE, "refresh"). But it doesn't seem to work. :huh2:

Have I done anything wrong?

Thanks everyone in advance, and have a great day. ;)

Edited by eEniquEe

Share this post


Link to post
Share on other sites



Hi eEniquEe,

how about writing the HTML to a temporary file and then displaying it? :huh2:


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

Hi eEniquEe,

how about writing the HTML to a temporary file and then displaying it? :huh2:

Thank you very much, it works like a charm. ;)

So, there's no way to construct a web-page directly from source without having to save the source into a temporary file first, right? I wonder if there's some other way to tackle this problem.

Thanks, :alien:

Share this post


Link to post
Share on other sites

Hi eEniquE,

I'm pretty sure that ther's a way to do what you want. But honestly I have no clue how to do it. So what I showed you may be a sub-optimal way to do this.

We'll see maybe until tomorrow somebody else has had a better idea. :-)


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

Well, he already has the source.

What he wants is to display a page without having to save the source into a file.

Sth like open a webpage with a variable as source.


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

"What he wants is to display a page without having to save the source into a file."

That is done with: _IEDocWriteHTML ( ByRef $o_object, $s_html )

See example in the help file.

HTH, Reinhard

Share this post


Link to post
Share on other sites

hi eEniquEe :huh2:

Here's a quick example :alien::

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

$oIE = _IECreateEmbedded()
$Form1 = GUICreate("_IEDocWriteHTML Demo", 600, 400)
$Obj1 = GUICtrlCreateObj($oIE, 5, 5, 590, 390)
_IENavigate($oIE, "about:blank")
GUISetState(@SW_SHOW)

SplashTextOn(@ScriptDir, "Please wait", 200, 50)
_IEDocWriteHTML($oIE, BinaryToString(InetRead("http://www.autoitscript.com")))
;_IEAction($oIE, "refresh") ;It is sometimes necessary to refresh the page after writing (e,g, after creating a FRAMESET)
SplashOff()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Hope this helps ;),

-smartee

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