PhilC
PhilC

Reputation: 418

AutoIt - Click a Link in a iFrame

I am new to using AutoIt. I have been struggling to click a link in an iframe using Internet Explorer. I have looked at several ways to do this but have not got anything to work.

So this is probably a simple question. How do a click a link inside an iFrame using AutoIt? The link is in frame 8 and the text name is "People".

Could someone please provide a example?

I assume I have to use _IEFrameGetCollection and _IELinkClickByText. I have also managed to identify the total number of frames on my page being 9 using _IEFrameGetCollection.

Upvotes: 1

Views: 4867

Answers (1)

Jos van Egmond
Jos van Egmond

Reputation: 2360

I assume I have to use _IEFrameGetCollection and _IELinkClickByText. I have also managed to identify the total number of frames on my page being 9 using _IEFrameGetCollection.

Precisely. You may want to see this answer first: Can't retrieve links inside Frame

Your code will end up something like:

#include <IE.au3>

$URL="http://www.acgme.org/adspublic/"
$MyIExplorer=_IECreate($URL,1,1,1,1)

Local $theFrame = _IEFrameGetCollection($MyIExplorer, 8)

Local $oLinks = _IELinkGetCollection($theFrame)
MsgBox(0, "Link Count", @extended & " links found")

Upvotes: 3

Related Questions