Jump to content

Internet Explorer Automation UDF library


DaleHohm
 Share

Recommended Posts

I know this question been asked before, but any chance we'll get a UDF for say.. opera, and firefox?

You're right - - asked and answered before. 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 have a question: how can get full name of a submit button knowing only half of the name?

ex:

3 INPUT -promote??????- Form Input Type: submit Value: Promote DispHTMLInputElement

Here -promote??????- is actually promote71377 but if i didnt know that, how can i get him?

in the code i get stuck in here.

_IELoadWait($oIE)

$o_all = _IETagNameAllGetCollection ($oIE)

$o_all.item("promote*").click

ive tryed with the * , but it didnt work.

AutoIt if more than a hobby. Is a way of life!http://www.autoitscript.com/forum/index.php?showtopic=26002 -my first projecthttp://www.autoitscript.com/forum/index.php?showtopic=26103 -my second project
Link to comment
Share on other sites

@michal.lowec - please open a thread in V3Support - this thread is too long to work point specific issues.

@sipher69 - I'll propose a quick answer here, but if you want to discuss further, please follow the advice above.

$o_inputs = _IETagNameGetCollection ($oIE, "Input")
For $o_input in $o_inputs
    if StringLeft ( $o_input.name, 7) = "promote" Then
        $o_input.click
        ExitLoop
    EndIf
Next

Dale

Edit: typo

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

So, do we have enough to add a hWnd2Obj() function to ie.au3?

Lar.

Yes, but I an concerned about the requirement for the active accessibility library to be available - I need to research how to detect it an how to fail gracefully if it's not found.

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

Can anyone suggest the best way to click on a button that has no alt txt, or name set.

I tried _IEClickImg() with no luck

here is the source on the button.

<input type="button" value="Proceed to iSolutions" class="Button" onclick="return _doClick('85256E6A006A87B3.bcc52f37e0a63dff85256ef6005d6b31/$Body/0.238C', this, null)"></div></td></tr>

its inside of a form , would a form submit work?

Link to comment
Share on other sites

thank you Dale. i've managed to resolve the problem.

Many thanks.

AutoIt if more than a hobby. Is a way of life!http://www.autoitscript.com/forum/index.php?showtopic=26002 -my first projecthttp://www.autoitscript.com/forum/index.php?showtopic=26103 -my second project
Link to comment
Share on other sites

Can anyone suggest the best way to click on a button that has no alt txt, or name set.

I tried _IEClickImg() with no luck

here is the source on the button.

<input type="button" value="Proceed to iSolutions" class="Button" onclick="return _doClick('85256E6A006A87B3.bcc52f37e0a63dff85256ef6005d6b31/$Body/0.238C', this, null)"></div></td></tr>

its inside of a form , would a form submit work?

I'll give a quick answer, but if this need more discussion, please add a post in V3 Support.

$o_inputs = _IETagNameGetCollection ($oIE, "Input")
For $o_input in $o_inputs
    if $o_input.value =  "Proceed to iSolutions" Then
        $o_input.click
        ExitLoop
    EndIf
Next

IEFormSubmit() could work but there is often Javascript attached to the submit button that makes that not work as expected.

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

in this example, the "endfor" is "next"?

$o_inputs = _IETagNameGetCollection ($oIE, "Input")

For $o_input in $o_inputs

if $o_input.value = "Proceed to iSolutions" Then

$o_input.click

ExitLoop

EndIf

EndFor

AutoIt if more than a hobby. Is a way of life!http://www.autoitscript.com/forum/index.php?showtopic=26002 -my first projecthttp://www.autoitscript.com/forum/index.php?showtopic=26103 -my second project
Link to comment
Share on other sites

in this example, the "endfor" is "next"?

Doh! I'll go back And fix the two example I entered like that...

thanks - the on-the-fly interpreter has no syntax checker.

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

another button problem.

the source code looks like that:

'<input type="button" value="Stay in the ' + traininggrounds + '" name="' + traininggrounds + '

When i visualize the form elements they look something like that:

0 INPUT market Form Input Type: hidden Value: 1 DispHTMLInputElement

1 INPUT market Form Input Type: button Value: Stay in the market DispHTMLInputElement

if i try to see the value of "market" it shows "1" not "Stay in the.." so i cant push the button in my code.

i've tryed something like this, but it didn't work:

code:

$o_inputs = _IETagNameGetCollection ($oIE, "Input")

For $o_input in $o_inputs

if strleft($o_input.value,7) = "Stay in" Then

$o_input.click

ExitLoop

EndIf

next

Edited by sipher69
AutoIt if more than a hobby. Is a way of life!http://www.autoitscript.com/forum/index.php?showtopic=26002 -my first projecthttp://www.autoitscript.com/forum/index.php?showtopic=26103 -my second project
Link to comment
Share on other sites

could someone post a usage format of this function?

_IEClickLinkByIndex()

_IEClickLinkByIndex($oIE, $index)

where $index is a number representing the position of the link of the colloection of all links on the page. This index starts with 0 and goes to [number of links - 1]

@sipher69 -- please post your question in the V3 Support Forum... this thread is too long to work poin-specific issue and others are also likely to jump in to help if you post a new thread.

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

Yes. Just pass in a frame object instead of $oIE.

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

Here is my IELoadWait 'helper' function and samples how I use them from other functions.

Note the necessary page timeout feature for lazy pages or server downtime. Works for me.

TODO: Error tracking should be improved. (w/ SetError())

TODO: Return to calling page on failure.

Func _IELoadWait(ByRef $oIE, $iPageTimeout = 10)
;;TODO: Error tracking should be improved. (w/ SetError())
;;TODO: Return to calling page on failure.
    Local $iTimeIni = TimerInit()
    While TimerDiff($iTimeIni) < $iPageTimeout * 1000;convert to miliseconds
        Sleep(50)
        If Not $oIE.busy Then
            If $oIE.readyState = "complete" Or $oIE.readyState = 4 Then Return (1 And Not @error)
        EndIf
    WEnd
    $oIE.Stop ()
;$oIE.GoBack ()
    Return (0)
EndFunc  ;==>_IEWait


Func _IENavigate(ByRef $oIE, $sUrl, $iPageTimeout = 20)
    $oIE.navigate ($sUrl)
    Return (_IELoadWait($oIE, $iPageTimeout) And Not @error)
EndFunc  ;==>_IENavigate
Func _IEFormSubmitByName(ByRef $oIE, $sFormName, $iPageTimeout = 40);increase when uploading files
    $oIE.document.getElementById ($sFormName).submit
    Return (_IELoadWait($oIE, $iPageTimeout) And Not @error)
EndFunc  ;==>_IEFormSubmitByName
;;... and so on ...;;
Link to comment
Share on other sites

I'm hoping I'm not making a newbie mistake with this, but I've spent so long on it that I'm going nuts.

I'm trying to make a script that loads ie and excel, and extracts the information from http://finance.yahoo.com/q/it?s=GM

and paste it into an excel file (the inside transaction table).

I'm having problems getting the table into an array with the _IETableWriteToArray() function. I've looked at the site code, but I can't make any sense of where the tables are at. I've tried just putting different numbers for the table, but I still come up with nothing.

Thanks in advance for any help.

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...