问题
I am trying to use AutoIt to retrieve some data from this website:
http://www.acgme.org/adspublic/default.asp
Unfortunately, the page uses frames and I'm having trouble navigating to the page where the data is.
The link is "Accredited Programs"
#include <IE.au3>
$URL="http://www.acgme.org/adspublic/"
$MyIExplorer=_IECreate($URL,1,1,1,1)
Local $theFrame = _IEGetObjById($MyIExplorer,"control")
MsgBox(0,"The Frame",$theFrame.src)
Local $oLinks = _IELinkGetCollection($theFrame)
MsgBox(0, "Link Count", @extended & " links found")
When I run the code above, I am able to populate $theFrame
with the correct frame object that houses the "Accredited Programs" link, but that's as far as I can get. The $oLinks
collection comes back empty.
回答1:
Frames are rather special. Use _IEFrameGetObjByName instead.
#include <IE.au3>
$URL="http://www.acgme.org/adspublic/"
$MyIExplorer=_IECreate($URL,1,1,1,1)
Local $theFrame = _IEFrameGetObjByName($MyIExplorer,"control")
Local $oLinks = _IELinkGetCollection($theFrame)
MsgBox(0, "Link Count", @extended & " links found")
来源:https://stackoverflow.com/questions/10982682/cant-retrieve-links-inside-frame