seco Posted November 13, 2007 Share Posted November 13, 2007 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. Link to comment Share on other sites More sharing options...
Blue_Drache Posted November 13, 2007 Share Posted November 13, 2007 (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 November 13, 2007 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
seco Posted November 14, 2007 Author Share Posted November 14, 2007 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. Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 14, 2007 Share Posted November 14, 2007 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. 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 Link to comment Share on other sites More sharing options...
seco Posted November 14, 2007 Author Share Posted November 14, 2007 why not use _IECREATE instead of _IEATTACH ? Link to comment Share on other sites More sharing options...
Nahuel Posted November 14, 2007 Share Posted November 14, 2007 why not use _IECREATE instead of _IEATTACH ?It'd be pretty much the same. Do as you wish... Link to comment Share on other sites More sharing options...
Blue_Drache Posted November 19, 2007 Share Posted November 19, 2007 Read the help file. You'll see the difference. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now