Jump to content

Help! with Extract Href Tags From _IEDocReadHTML


Recommended Posts

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
Link to comment
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

Link to comment
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.

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