Jump to content

Internet Explorer Automation UDF library


DaleHohm
 Share

Recommended Posts

hmm... i'm having trouble with the _IEFormGetObjByName, beecause the form i'm trying to target doesn't have quotations around the name, well, i'm guessing that's what the problem is, since it can't seem to find the form... (all i did was take ur hotmail one, and changed the url, and form names.)

[quote]If whenever you feel small, useless, offended, depressed, and just generally upset always remember......you were once the fastest and most vicious sperm out of hundreds of millions![/quote]

Link to comment
Share on other sites

See reply 37 in this thread for a utility script that will spit out the names of the objects on your webpage.

Dale

hmm... i'm having trouble with the _IEFormGetObjByName, beecause the form i'm trying to target doesn't have quotations around the name, well, i'm guessing that's what the problem is, since it can't seem to find the form... (all i did was take ur hotmail one, and changed the url, and form names.)

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

thankx, that script works like a charm. Got it working and was using it for all sorts of stuff. But the main reason why i even needed this in the first place, since looking at the source couldnt' get me it, was because my cousin wanted me to make some kind of auto-login script for some site he plays at( http://rwk2.racewarkingdoms.com/). and i jsut can't seem to get it working. I could just leave it, and go by mouseclicks or something to put the stuff in, but i'm just really curious why it doesn't work now. I can find all sorts of forms n stuff everywhere else, but for some reason, when i run that script of urs on that site, it returns a blank page...

[quote]If whenever you feel small, useless, offended, depressed, and just generally upset always remember......you were once the fastest and most vicious sperm out of hundreds of millions![/quote]

Link to comment
Share on other sites

If you do a View Source on that page you'll see it uses Frames:

<frameset rows="*,0,0" framespacing="0" border="0" frameborder="0">
<frame name="main" src="start.htm" scrolling="auto" noresize marginwidth="0" marginheight="0">
<frame name="poll" src="pol.htm" scrolling=no noresize marginwidth="0" marginheight="0">
<frame name="poll2" src="poll.htm" scrolling=no noresize marginwidth="0" marginheight="0">
</frameset>

You need to get an object reference to the frame first and then to the form in the frame. Check out the _IEFrameGetObjByName function -- I think there is an example in reply 3 to this post.

Dale

thankx, that script works like a charm. Got it working and was using it for all sorts of stuff. But the main reason why i even needed this in the first place, since looking at the source couldnt' get me it, was because my cousin wanted me to make some kind of auto-login script for some site he plays at( http://rwk2.racewarkingdoms.com/). and i jsut can't seem to get it working. I could just leave it, and go by mouseclicks or something to put the stuff in, but i'm just really curious why it doesn't work now. I can find all sorts of forms n stuff everywhere else, but for some reason, when i run that script of urs on that site, it returns a blank page...

Edited by DaleHohm

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

Hmm... i used the function u gave me, and once again, i got it to work on other sites, but it doesn't seem to work on this one. It's really weird, and i don't really understand it...

#include <IE.au3>

; Set a COM Error handler -- only one can be active at a time (see helpfile)
$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

; Create a browser window, navigate and click to the AutoIt Forum Search page
$oIE = _IECreate ()
_IENavigate ($oIE, "http://rwk2.racewarkingdoms.com/")

$oIE = _IEFrameGetObjByName ($oIE, "main")

; Show information for each HTML elemetn on a page
$o_all = _IETagNameAllGetCollection ($oIE)
$sHTM = _IECollectionTable($o_all, "Characteristics of all HTML Elements on page")
$oIE1 = _IECreate ()
_IEBodyWriteHTML ($oIE1, $sHTM)

; Show information for each A (anchor) tag
$o_all = _IETagNameGetCollection ($oIE.document, "a")
$sHTM = _IECollectionTable($o_all, "Characteristics of all 'a' Links")
$oIE2 = _IECreate ()
_IEBodyWriteHTML ($oIE2, $sHTM)

; Show attributes for each IMG tag
$o_all = _IETagNameGetCollection ($oIE.document, "img")
$sHTM = _IECollectionTable($o_all, "Characteristics of all 'img' Links")
$oIE3 = _IECreate ()
_IEBodyWriteHTML ($oIE3, $sHTM)

; Show information on each form and its elements
$o_all = _IEFormGetCollection ($oIE.document)
$oIE4 = _IECreate ()
$icnt = 0
For $form in $o_all
    $sBody = _IEBodyReadHTML($oIE4)
    If $icnt = 0 Then $sBody = ""
    $sHTM = _IECollectionTable($form, "Elements for form " & $icnt)
    _IEBodyWriteHTML ($oIE4, $sBody & $sHTM)
    $icnt = $icnt + 1
Next

Exit

All i did was pretty much copy paste, and change wat needed to be changed... i don't get why it doesnt' work on that particular site ;)

[quote]If whenever you feel small, useless, offended, depressed, and just generally upset always remember......you were once the fastest and most vicious sperm out of hundreds of millions![/quote]

Link to comment
Share on other sites

So you've gotten far enough to reveal all the objects on the page. The login form is named 'thelogin', the character field is called 'login', the password field is 'password'. The other important thing is that it doesn't appear that a simple form submit action will work on this page -- you'll need to do a .click action on the Login button which is called 'subshit' (not a typo on my part).

There is an example of this .click method in reply 3 of this post.

Dale

Edited by DaleHohm

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

ya, i understood what i would have to do and everything, but the thing is that my scripts never actually ran on that site, and i tihnk i just realised why... it just stalls when it hits the navigate... it doesn't think the site is done loading, when it is. Besides that, i don't think i'll have any more trouble ;)

::edit:: oh btw, how do u work the attach code? i can't seem to figure that out...

Edited by Faleira

[quote]If whenever you feel small, useless, offended, depressed, and just generally upset always remember......you were once the fastest and most vicious sperm out of hundreds of millions![/quote]

Link to comment
Share on other sites

I found that the page you noted actually redirects to an index.html page after playing an intro. You probably want to navigate directly to it: http://rwk2.racewarkingdoms.com/index.html

If you already have that page open, the following works:

$oIE = _IEAttach("http://rwk2.racewarkingdoms.com/index.html", "url")

If you have more trouble, please post code along with your descriptions.

Dale

ya, i understood what i would have to do and everything, but the thing is that my scripts never actually ran on that site, and i tihnk i just realised why... it just stalls when it hits the navigate... it doesn't think the site is done loading, when it is. Besides that, i don't think i'll have any more trouble ;)

::edit:: oh btw, how do u work the attach code? i can't seem to figure that out...

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

Ok, this is a new question completely. ;) (i feel like i'm annoying you... :"> )

but,, can any of the getobj functions be used to check if an image is on the current site or not? ( by source, text or alt)

Edit: nvm, i figured it out on my own ^^

Edited by Faleira

[quote]If whenever you feel small, useless, offended, depressed, and just generally upset always remember......you were once the fastest and most vicious sperm out of hundreds of millions![/quote]

Link to comment
Share on other sites

There is an optional parameter on _IECreate to suppress window visibility. Just make sure you do an _IEQuit when you are done or you will have a zombie process running.

Dale

Can i make it do this all in the background so no window will be seen?

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

Is their a way i can use this to stop images from loading in my iexplore process or window? Thanks. Also I can't post my code in the public forum or anything because I might pm if anyone could help me. But when i am submitting forms it someitmes jumps to the next thing by itself. Even If i have a Sleep or something

Edited by Ic3c0ld
Link to comment
Share on other sites

Not necessarily faster, but more surgical perhaps.

_IEBodyGetHTML will return the HTML in the mail body and you can do the StringInStr on that. Or, you can use the .innerHTML and .innerText on any tag in the document...

Dale

How can I look make it look at a html source and see if a string is inside it. I could do it a wierd way with WinHTTP and StringInStr but this could probably be done faster with 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

Link to comment
Share on other sites

$oFrom = _IEFormGetObjByIndex($oIE, 0)

Dale

How do I use a form that has no name? Like their is only one form in the whole page and its liek

<Form Action="Action">

<input>

<input>

</Form>

How do i refrence to that?

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

Why won't this work? Any help is appreciated.

#include <IE.au3>

$PAGE = InputBox("WebPage To Alter", "Type WebSite Address")
$BrowerHook = _IECreate()

AlterSite()

Func AlterSite()
    _IENavigate($BrowerHook, $PAGE)
    $WebPage = _IEBodyReadHTML($BrowerHook)
    If StringInStr($WebPage, ".jpg") Then
        $NewPage1 = StringReplace($WebPage,".jpg", "...")
        _IEBodyWriteHTML($BrowerHook, $NewPage1)
    EndIf
    If StringInStr($WebPage, "javascript") Then
        $NewPage2 = StringReplace($WebPage,"javascript", "...")
        _IEBodyWriteHTML($BrowerHook, $NewPage2)
    EndIf
    If StringInStr($WebPage, "jscript") Then
        $NewPage3 = StringReplace($WebPage,"jscript", "...")
        _IEBodyWriteHTML($BrowerHook, $NewPage3)
    EndIf
    If StringInStr($WebPage, ".gif") Then
        $NewPage3 = StringReplace($WebPage,".gif", "...")
        _IEBodyWriteHTML($BrowerHook, $NewPage3)
    EndIf
    If StringInStr($WebPage, ".bmp") Then
        $NewPage3 = StringReplace($WebPage,".bmp", "...")
        _IEBodyWriteHTML($BrowerHook, $NewPage3)
    EndIf
    If StringInStr($WebPage, ".swf") Then
        $NewPage3 = StringReplace($WebPage,".swf", "...")
        _IEBodyWriteHTML($BrowerHook, $NewPage3)
    EndIf
EndFunc

Its prob easy but idk thanks.

Link to comment
Share on other sites

I believe you'll find this is a simple logic issue having nothing to do with IE.au3.

I presume that you are trying to make your changes cumulative, but you revert back to the same original $WebPage value for each search, substitution and _IEBodyWriteHTML.

Hopefully this is enough to get you going.

Dale

Edited by DaleHohm

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

I believe you'll find this is a simple logic issue having nothing to do with IE.au3.

I presume that you are trying to make your changes cumulative, but you revert back to the same original $WebPage value for each search, substitution and _IEBodyWriteHTML.

Hopefully this is enough to get you going.

Dale

Ahh ok I see what your saying but it doesn't change anything at all. I

Link to comment
Share on other sites

Well in fact it certainly does changes things. If you want to discuss this further, please open a thread in the V3 Support forum so that this thread does not become further polluted.

Dale

Ahh ok I see what your saying but it doesn't change anything at all. I

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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