Sign in to follow this  
Followers 0
John117

change active IE webpage.

7 posts in this topic

I have seen scripts to create a new IE Page in a new browser. (Creates body and all in code)

I have seen scripts to change the url of the current browser. (Does not create body)

Can anyone show me any example of changing the current browser to a new IE Page. (A page with a body written in code/not a url)

Share this post


Link to post
Share on other sites



#include <IE.au3>
$oIE = _IECreate()
$sPage = "<HTML><HEAD></HEAD><BODY>Page 1</BODY></HTML>"
_IEDocWriteHTML($oIE, $sPage)
$sPage = "<HTML><HEAD></HEAD><BODY>Page 2</BODY></HTML>"
_IEDocWriteHTML($oIE, $sPage)

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 -Thanks for the reply :) Im sorry to say I wasn't clear enough with my request. :P

suppose I open IE and naviate to a url (any url)

I then run your code to create my page.

I would like the result to be that the already opened IE just changes to mine. (not a second browser popup)

Can this be done?

Share this post


Link to post
Share on other sites

Sounds rather shady... please don't make me part of something nefarious...

#include <IE.au3>
$oIE = _IECreate("http://www.google.com")
$sPage = "<HTML><HEAD></HEAD><BODY>Page 1</BODY></HTML>"
_IEDocWriteHTML($oIE, $sPage)
$sPage = "<HTML><HEAD></HEAD><BODY>Page 2</BODY></HTML>"
_IEDocWriteHTML($oIE, $sPage)

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

Nefarious and shady? :)

na, :P here's the post to give you a little insite.

http://www.autoitscript.com/forum/index.ph...st&p=385639

I was hoping to do the following without it opening a new window, since the user will already have the browser open when typing www.yahoo.com

I tried what you posted shortly after my last reply. It still opened a new window.

I also tried to set it up as _IENavigate but since I never opened the first browser, $oIE was not declared so it had no reference.

Could I use something to find the active IE? With www.yahoo.com in the addressbar?

(!) Thanks - Code below

CODE
#include <GuiConstants.au3>

#include <file.au3>

#include <IE.au3>

Dim $aRecords, $bRecords, $cRecords

If Not _FileReadToArray(@ScriptDir & "\A.txt", $aRecords) Then

MsgBox(4096, "Error", " Error reading A.txt log to Array error:" & @error)

Exit

EndIf

If Not _FileReadToArray(@ScriptDir & "\B.txt", $bRecords) Then

MsgBox(4096, "Error", " Error reading B.txt log to Array error:" & @error)

Exit

EndIf

If Not _FileReadToArray(@ScriptDir & "\C.txt", $cRecords) Then

MsgBox(4096, "Error", " Error reading C.txt log to Array error:" & @error)

Exit

EndIf

$oIE = _IECreate()

$MyMessage = $aRecords[Random(1, UBound($aRecords) - 1, 1) ] & $bRecords[Random(1, UBound($bRecords) - 1, 1) ] & $cRecords[Random(1, UBound($cRecords) - 1, 1) ]

$sPage = "<HTML><HEAD></HEAD><BODY>" & $MyMessage & "</BODY></HTML>"

_IEDocWriteHTML($oIE, $sPage)

sleep (4000)

_IENavigate($oIE, "http:\\www.yahoo.com")

BTW-Nefarious gets me fired (!) funny gets overlooked :) / This will not work with out building the txt files listed in the link :)

Share this post


Link to post
Share on other sites

So, if "existing" browser is what you want... see _IEAttach -- lots of options on how to use it.

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

Will study up tomorrow evening from the help file :) thanks!

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