Jump to content

IE.au3 and links


3telnick
 Share

Recommended Posts

I'm trying to do quite simple thing, that is to open page and click particular link on that page.

When I show collection of all the links it seems to be ok, but when I try to click any link (by its index) I got error message:

$links($_index).click

Error: Illegal text at the end of atatement (one tatement per line).

Invalid characters behind Object assignment!

When I try to click link by its text script just do nothing...

Below simple code source:

#include <c:\Program Files\AutoIt3\Include\IE.au3>

$oIE = _IECreate()

_IENavigate($oIE, "http://www.somewhere.com/index.html")

_IELoadWait($oIE)

JustDoIt ("title","address","link to click")

$oIE = _IEAttach ("somewhere","url")

_IEAction ( $oIE, "quit")

Func JustDoIt ($linka,$adres,$kliknij)

_IEImgClick($oIE, $linka, "alt")

$oIE = _IEAttach ($adres,"url")

_IELinkClickByIndex ($oIE, 0)

#cs

$oLinks = _IELinkGetCollection ($oIE)

For $oLink In $oLinks

MsgBox(0, $oLink.id, $oLink.href)

Next

#ce

_IEAction ( $oIE, "quit")

EndFunc
Link to comment
Share on other sites

Is this really the exact message you get?

$links($_index).click

If so, something happened to your IE.au3 file... it should be:

$links($i_index).click

As Balachander K says, it is also a good idea to check your return values and @ERROR

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

Error message is $links($i_index).click (my fault).

@ERROR returns 0 so it is ok (after all _IEAction ( $oIE, "quit") works perfectly).

If I undo comment for part

$oLinks = _IELinkGetCollection ($oIE)

For $oLink In $oLinks

MsgBox(0, $oLink.id, $oLink.href)

Next

it returns all links on the page.

Only _IELinkClickByIndex ($oIE, 0) doesn't work (I mean, fails with error mentioned before).

Link to comment
Share on other sites

Error message is $links($i_index).click (my fault).

@ERROR returns 0 so it is ok (after all _IEAction ( $oIE, "quit") works perfectly).

If I undo comment for part

$oLinks = _IELinkGetCollection ($oIE)

For $oLink In $oLinks

MsgBox(0, $oLink.id, $oLink.href)

Next

it returns all links on the page.

Only _IELinkClickByIndex ($oIE, 0) doesn't work (I mean, fails with error mentioned before).

Please download the latest version T2.0-2 and run in SciTe to get diagnostic messages as you run it.

Also, please try to provide a reproducer that is accessible to me on the Internet.

Dale

Update: I can now reproduce. Stand by.

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

Please test with new version T2.0-3 and reporting any problems.

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