Sign in to follow this  
Followers 0
seco

how to read the <a>somtext </a> tag

7 posts in this topic

Hi

i have a tag like this how to read it and all its attributes?

<a title='sometext' class='first' href='www.google.com' style='text-decoration: none;'>
<div class='icon'>
</div>
the text goes here
</a>

thanks in advance.

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

#include <IE.au3>
$oIE = _IEAttach("Internet Explorer", "Title")
$oLinkCollection = _IETagNameGetCollection($oIE, "A") ; Get all tags that are of type "A"
$Count = @extended
ConsoleWrite("Debug: Found " & $Count & " input tags" & @LF)
If $Count Then
    For $oLink In $oLinkCollection ; For each $oLink found in the $oLinkCollection collection,
        $intCount += 1
        ConsoleWrite("Count: " & $intCount & @LF)
        ConsoleWrite("Title: " & $oLink.title & @LF)
        ConsoleWrite("Class: " & $oLink.class & @LF)
        ConsoleWrite("href: " & $oLink.href & @LF)
        ConsoleWrite("Style: " & $oLink.style & @LF)
        ConsoleWrite(@LF)
    Next
EndIf

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

thsanks for reply

im sorry the code you gave me gives errors and i can't fix it still beginner

ok but i understand it that the function _IETagNameGetCollection gets all the tags that named <a>

but i think i will use _IECreate and then _IETagNameGetCollectio to get the <a> tags on the page and i want to ask how to iterate through them? because the code you write gives error on the for loop

thanks in advance.

Share this post


Link to post
Share on other sites

thsanks for reply

im sorry the code you gave me gives errors and i can't fix it still beginner

ok but i understand it that the function _IETagNameGetCollection gets all the tags that named <a>

but i think i will use _IECreate and then _IETagNameGetCollectio to get the <a> tags on the page and i want to ask how to iterate through them? because the code you write gives error on the for loop

thanks in advance.

You would have to tweak this line to match your IE window (already opened to the page) for it to find the tags:

$oIE = _IEAttach("Internet Explorer", "Title")

See the help file under _IEAttach() for ways to specify your actual IE window.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

why not use _IECREATE instead of _IEATTACH ?

Share this post


Link to post
Share on other sites

why not use _IECREATE instead of _IEATTACH ?

It'd be pretty much the same. Do as you wish...

Share this post


Link to post
Share on other sites

Read the help file. You'll see the difference.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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  
Followers 0