Jump to content

how to collection some links form some area


tan133
 Share

Recommended Posts

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
Link to comment
Share on other sites

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