Jump to content

IE.au3 and a complex web page.


ame1011
 Share

Recommended Posts

First of all, yes the following page is from a kids site. (ages 11-17+)

and yes I am making an automated avertising script. Millions of people in one demographic all in one place.. couldnt help myself.

Anyway, take a look at the page attached.

I have made a script that adds data to the recipient and title form elements.

However, the message body element is a bit strange. When viewing page info with firefox, it tells me

that the form element is called "message_body" and that it is hidden. When I Use the following code:

$oForm = _IEFormGetObjByName($oIE, "neomessage")
$oMessage = _IEFormElementGetObjByName ($oForm,"message_body")
_IEFormElementSetValue ($oMessage,"message")

the message element does not get accepted. I believe that this box is a frame by itself. I right clicked on it

in firefox and pressed 'view frame source' and got:

<html id="message_body">
<head>
<style type="text/css">BODY { font-family: Verdana; font-size: 10pt; } </style>
<style>
body {
    background: #FFFFFF;
    margin: 0px;
    padding: 0px;
}
</style>
</head>
<body>

</body>
</html>

I am completely lost, am i missing something?

Any help is appreciated.

Page.html

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

I've never seen this done before, but it appears that even though that text portion of the page looks like a FORM, it is actually an iFrame and the updatable text area appears to be the BODY of the document in that iFrame.

I think you'll find that this works:

#include <IE.au3>

$oIE = _IEAttach("Neopets")
$oMb = $oIE.document.frames.item("message_body"); Get reference to the iFrame
_IEBodyWriteHTML($oMb, "Hello, can anybody tell me how the Neopets site is free, yet my daughter has spent hundreds of dollars on stuffed animals?  BTW, what the heck is a 'Grundo'?")

Dale

First of all, yes the following page is from a kids site. (ages 11-17+)

and yes I am making an automated avertising script. Millions of people in one demographic all in one place.. couldnt help myself.

Anyway, take a look at the page attached.

I have made a script that adds data to the recipient and title form elements.

However, the message body element is a bit strange. When viewing page info with firefox, it tells me

that the form element is called "message_body" and that it is hidden. When I Use the following code:

$oForm = _IEFormGetObjByName($oIE, "neomessage")
$oMessage = _IEFormElementGetObjByName ($oForm,"message_body")
_IEFormElementSetValue ($oMessage,"message")

the message element does not get accepted. I believe that this box is a frame by itself. I right clicked on it

in firefox and pressed 'view frame source' and got:

<html id="message_body">
<head>
<style type="text/css">BODY { font-family: Verdana; font-size: 10pt; } </style>
<style>
body {
    background: #FFFFFF;
    margin: 0px;
    padding: 0px;
}
</style>
</head>
<body>

</body>
</html>

I am completely lost, am i missing something?

Any help is appreciated.

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

Link to comment
Share on other sites

wow dale, you're the best.

Is there some place that I can get my hands on all of the info that is not in your little 'help file/post'?

Where did the .document.frames stuff come from and why didnt you use the '_IEgetproperty' function for getting the refrence to the iframe?

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

wow dale, you're the best.

Is there some place that I can get my hands on all of the info that is not in your little 'help file/post'?

Where did the .document.frames stuff come from and why didnt you use the '_IEgetproperty' function for getting the refrence to the iframe?

My knowledge about this stuff comes from msdn.microsoft.com and the O'Reilly Dynamic HTML book.

I have Frames functions in IE.au3, but have recently discovered that they do not work flawlessly with iFrames -- there are some differences between frameset frames and iFrames that I have not figured out how to generalize yet -- one of the only major issues identified with IE.au3 and I'm trying to get ironed out for the next release.

Dale

p.s. _IEGetProperty would not help with this issue... it has a different use entirely

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

Link to comment
Share on other sites

thanks, and i didnt mean the actual '_IEgetproperty' function, i meant:

_IEFrameGetObjByIndex

_IEFrameGetObjByName

the '_IEGET' functions

but you already answered that when explaining the problems with iframes.

thanks again.

Edited by ame1011
[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

Hi Dale,

good to know you are still trying to crack the IFRAMEs nut :-)

I need this to make my KeePass Form Filler perfect :-)

http://keepass.sourceforge.net/plugins.php#formfiller

Thanks!

Dave

thanks, and i didnt mean the actual '_IEgetproperty' function, i meant:

_IEFrameGetObjByIndex

_IEFrameGetObjByName

the '_IEGET' functions

but you already answered that when explaining the problems with iframes.

thanks again.

Link to comment
Share on other sites

Hi Dave -- I hoped you were listening. Wanted you to see that the following worked for instantiating an iFrame document:

$oMb = $oIE.document.frames.item("message_body")
I now just need to work the nuances back into the main code stream.

Dale

Hi Dale,

good to know you are still trying to crack the IFRAMEs nut :-)

I need this to make my KeePass Form Filler perfect :-)

http://keepass.sourceforge.net/plugins.php#formfiller

Thanks!

Dave

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

Link to comment
Share on other sites

Hi Dale,

I am listening B)

When you test, then try this page please. It contains IFRAMEs and each IFRAME contains a FORM. Please note that the IFRAMEs don't have any names assigned.

http://www.unicreditbanca.it/web

Thanks for investigating this hard nut.

Dave

Hi Dave -- I hoped you were listening. Wanted you to see that the following worked for instantiating an iFrame document:

$oMb = $oIE.document.frames.item("message_body")
I now just need to work the nuances back into the main code stream.

Dale

Link to comment
Share on other sites

Hi Dale,

Did you crack the IFRAMEs nut already? This seem to be a tough one.

Even DOM inspector doesn't seem to able to drill into IFRAMEs (but framsets work fine).

DOM inspector is actually a nice app (but not freeware)

http://www.ieinspector.com/dominspector/download.html

Cheers, Dave

Hi Dale,

I am listening B)

When you test, then try this page please. It contains IFRAMEs and each IFRAME contains a FORM. Please note that the IFRAMEs don't have any names assigned.

http://www.unicreditbanca.it/web

Thanks for investigating this hard nut.

Dave

Link to comment
Share on other sites

I believe that the strangeness is that the parent of a Frame is a Window object and the parent of an iFrame is a document object. I just need to dedicate a little time to testing and I'll have this knocked out.

Yes, I've tried out DOM Inspector and I've found a couple of others as well. I'll post a new topic with some pointers to these so that everyone can find them.

thanks,

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...