Sign in to follow this  
Followers 0
brodie28

Editing internet explorer pages with autoit

8 posts in this topic

I think I remember seeing a function that edited an internet page... Obviously not on the server, but edited the page stored in temp memory.

Using this you could change the name of links and etc. By changing the site saved in temp memory.

Share this post


Link to post
Share on other sites



What I am trying to do is have the script navigate to a page, and when the page is loaded, have it change things on the loaded page by editing it client side.

So I can change links and such on a web page client side.

Share this post


Link to post
Share on other sites

I think I remember seeing a function that edited an internet page... Obviously not on the server, but edited the page stored in temp memory.

Using this you could change the name of links and etc. By changing the site saved in temp memory.

IE.au3 (now part of the standard UDF functions in the latest betas) gives you _IEBodyReadHTML and _IEBodyWriteHTML that gives you one way to do this. See the helpfile under User Defined Functions, IE Management.

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

What I am trying to do is have the script navigate to a page, and when the page is loaded, have it change things on the loaded page by editing it client side.

So I can change links and such on a web page client side.

Right, that is what the functions I referenced do. Take a look at the examples in the helpfile.

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

Thanks alot.

It looks like there is an example that does exactly what I need.

IE really is a great UDF.

Share this post


Link to post
Share on other sites

Well I tried the example and it works great... The problem is though, when I tried the exact same script with some different values for search and replace on a different site, it didn't work.

This is one I tried on google...

#include <IE.au3>

$oIE = _IECreate()

_IENavigate($oIE, "www.google.com")

$body = _IEBodyReadHTML($oIE)

If StringInStr($body, "Search") Then

MsgBox(0, "Success", "The string was found")

$newbody = StringReplace($body, "automation", "Pwnt")

_IEBodyWriteHTML($oIE, $newbody)

Else

MsgBox(0, "Fail", "The string was NOT found")

EndIf

Exit

Share this post


Link to post
Share on other sites

Turns out I am in idiot and forgot to change something.

Sorry.

Thanks again.

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