Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Read and Extract Text from HTML Path (VBA 6.5 Access 2007)

    Hi,

    All Comments welcome.

    I'm looking into writing code for a "Crawler", that will have list of URLs and then Parse text looking for Keywords on a Live internet based HTML pages.

    Specifically, I see the base code structure as Follows:

    1) Reference URL from Access Table
    2) Open URL (? Internet Explorer)
    3) Parse Text for Keywords
    4) Store Matched Data.
    5) next URL

    The big Problem is How do I reference the Contents/Text in VBA/VB, to read line by line in from a Live Page in IE (I could Download and Discard the document)??

    Thanks

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Read and Extract Text from HTML Path (VBA 6.5 Access 2007)

    Open the VBA and select Tools, references.

    Find and check the item called "Microsoft XML, v6.0"

    Now try this code:

    <pre>Option Explicit

    Public Function GetPage(sLink As String) As XMLHTTP40
    Dim oObj As MSXML2.XMLHTTP40
    Set oObj = New XMLHTTP40
    oObj.Open "GET", sLink, False
    oObj.send ""
    Set GetPage = oObj
    End Function

    Public Sub Demo()
    Dim oResult As XMLHTTP40
    Set oResult = GetPage("http://www.jkp-ads.com")
    MsgBox oResult.responseText
    End Sub
    </pre>

    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Read and Extract Text from HTML Path (VBA 6.5 Access 2007)

    Cheers Jan

    Excellent that look like It'll Do it.
    I'll be getting this project in the Next couple of weeks, so If I have any Comments I will add them here then.
    This just Confirms Viability!! [img]/forums/images/smilies/wink.gif[/img] The easy way

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •