Sign in to follow this  
Followers 0
Lmac34

Help! with Extract Href Tags From _IEDocReadHTML

3 posts in this topic

#1 ·  Posted (edited)

Anyone Out there know a quick and easy way to extract all

'<a href="http://.*" title' from the Result of _IEDocReadHTML ($oIE)

example code dose not Work

need help with StringRegExp

local $amt = _GUICtrlListBox_GetListBoxInfo($lstPages)
    local $index = 0
    while $index < $amt
        local $webpage =  _GUICtrlListBox_GetText($lstPages, $index)
        $oIE = _IECreate ($webpage,0,0,1,1)
        $sHTML = _IEDocReadHTML ($oIE)
        _IEQuit ($oIE)
        local $regExp = '(?i<a href=\"http\://.*\"\stitle)*'
        local $ArrayofMatchs = StringRegExp ($sHTML,$regExp,1)
        _ArrayDisplay($ArrayofMatchs,"Test")
        $index = $index + 1
    WEnd

any help would be much appreciated.

regards

lmac34

Edited by Lmac34

Share this post


Link to post
Share on other sites



Just try _IELinkGetCollection($oIE):

#include <IE.au3>
$oIE = _IECreate("autoitscript.com")
$links = _IELinkGetCollection($oIE)
For $link In $links
$URL = $link.href
$name = $link.innerHTML
ConsoleWrite($URL & " - " & $name & @CRLF)
Next

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Just try _IELinkGetCollection($oIE):

#include <IE.au3>
$oIE = _IECreate("autoitscript.com")
$links = _IELinkGetCollection($oIE)
For $link In $links
$URL = $link.href
$name = $link.innerHTML
ConsoleWrite($URL & " - " & $name & @CRLF)
Next

That Will work Perfectly Thanks Very Much.

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