Jump to content
Sign in to follow this  
tan133

how to collection some links form some area

Recommended Posts

tan133

there is a test file like this:

<html>

<head><title>测试用</title></head>

<table>

<TBODY>

<SPAN id=test><A href="http://1st.com">1stlink</A></SPAN>

</TBODY>

<TBODY id = main>

<TH class=common>

<SPAN id=test><A href="http://2nd.com">2ndlink</A></SPAN>

</TH>

</TBODY>

</table>

</html>

===========================================

i want to get collection of all links in the table

and write a script like this:

#include <IE.au3>
$oIE = _IECreate (@ScriptDir&"\test.htm")

$o_TBODYs = _IETagNameGetCollection($oIE,"a")
For $o_a In $o_TBODYs
    $oLinks = _IELinkGetCollection ($o_A)
    For $oLink In $oLinks
        MsgBox(0, "Link Info", $oLink.outertext)
    Next
Next

_IEQuit($oIE)
Edited by tan133

Share this post


Link to post
Share on other sites
tan133

the script will show all links once when get a link

so ,it will the msgbox 4 times (2*2)

if write like this

MsgBox(0, "Link Info", $o_a.document.links(0).href)

it will msgbox the first link every time

my question is :

how to get all links in the table,and show them all 1by1

sorry to ask so simple a question

i am a freshman here,and also a freshman of autoitscript

anybody can give me a help?

tks

Edited by tan133

Share this post


Link to post
Share on other sites
tan133

ok

maybe question is not clear enough

maybe it is too hard

i give up

if you have answer to this

no need to give me ,3x

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.