Sign in to follow this  
Followers 0
=sinister=

Replacing IE images.

7 posts in this topic

I tried this:

$oIE = _IEAttach ('test.gif', 'Embedded', $i)
_IEBodyWriteHTML ($oIE, "")

However, it never removes the image. I also tried using the search type "HTML".

Share this post


Link to post
Share on other sites



If you're directly displaying the image without HTML, there is no HTML to remove. You have to navigate to a different page or use the HTML <img> tag if you want to erase the image from the page.

Share this post


Link to post
Share on other sites

The html <img> tag is used. My test html file is like this:

<body>
<img src="www.egocities.com/images/watermark/geocities.gif">
</body>

My goal is to remove the entire <img> tag using the _IE functions.

Share this post


Link to post
Share on other sites

remove it from what?


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

Removing it from the page

Let's say my "test.jpg" is just a blank image.

$oIE = _IEAttach ('<img src=test2.jpg>', 'HTML', 1)
_IEBodyWriteHTML ($oIE, '<img src=test.jpg>')

My html file is this:

<html>
<header>
</header>
<body>
<img src=test2.jpg>
</body>
</html>

It will not work, nor will it work with the "Embedded" instead of "HTML".

Share this post


Link to post
Share on other sites

You can obviously only affect what is in the browser, not the source file.

Here are several examples that demonstrate what I think you wnat to do:

#include <ie.au3>
; 1
$oIE = _IE_Example()
sleep(2000)
_IEBodyWriteHTML($oIE, '<IMG src="http://www.autoitscript.com/images/download_autoit.png">')
; 2
$oIE = _IE_Example()
sleep(2000)
$oImg = _IETagnameGetCollection($oIE, "img", 0)
_IEPropertySet($oImg, "outerhtml", '<IMG src="http://www.autoitscript.com/images/download_autoit.png">')
; 3
$oIE = _IE_Example()
sleep(2000)
$oImg = _IETagnameGetCollection($oIE, "img", 0)
$oImg.src = "http://www.autoitscript.com/images/download_autoit.png"

Dale

1 person likes this

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

Dale,

That was a perfect example of what I needed, 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