Jump to content

problem with IE getobjbyname and linkclickbytext


Recommended Posts

when I use _IEgetobjbyname() and _IElinkclickbytext() they always answer 0, even if the link isnt there...

I have tried using @extended, and that turns up 0 no matter what also (doesn't matter whether the object/link is there or not). does anyone know how to fix this?

Example: I go to a web page with a link named "click here" and use _IElinkclickbytext() or _IEgetobjbyname() and it turns up 0... @extended turns up 0 also.

Then i go to a web page without the link named "click here" and then it does the same thing.

What goes around comes around... Payback's a bitch.

Link to comment
Share on other sites

I cant see any problems :lmao::ph34r:

#include <IE.au3>

$a = _IECreate ("http://www.google.com")
$b = _IEFormGetObjByName ($a, "f")
$c = _IEFormElementGetObjByName ($b, "q")
$d = _IEPropertyGet ($a, "hwnd")
WinSetState($d, "", @SW_MAXIMIZE)
_IELoadWait ($a)
_IEFormElementSetValue ($c, "Failure")
_IEFormSubmit ($B)
_IELoadWait ($a)
_IELinkClickByText ($a, "President of the United States - George W. Bush")
Edited by AceLoc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Link to comment
Share on other sites

I'm not trying to click on something (unless I have to), I am trying to find out how many instances there are of a certain link. sorry if my first post was confusing.

What goes around comes around... Payback's a bitch.

Link to comment
Share on other sites

I'm not trying to click on something (unless I have to), I am trying to find out how many instances there are of a certain link. sorry if my first post was confusing.

so tell me exactly what you wanna do then? :lmao: Edited by AceLoc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Link to comment
Share on other sites

ok, so for example...

there is 2 "click here" links on the page.

I want a function to return 2 (or @extended to return 2), and then if I navigate to a different page, without any "click here" links, the function would return 0.

is that a good enough explanation?

What goes around comes around... Payback's a bitch.

Link to comment
Share on other sites

ok, so for example...

there is 2 "click here" links on the page.

I want a function to return 2 (or @extended to return 2), and then if I navigate to a different page, without any "click here" links, the function would return 0.

is that a good enough explanation?

They don't work that way. Please read the Return Value docs in the helpfile.

You'll need to loop through _IELinkGetCollection checking the.innerText property and count yourself.

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