Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88

    Question Unanswered: Automatic importation of HTML pages

    I have a question concerning the importation and transformation of an HTML web page as an Access table. Is it possible to configure Access so that it automatically recognizes a keyword from an HTML page (e.g. expertise) and assigns the associated text of that keyword to a column? This text being one of the records associated with the HTML page. There will be other keywords such as Expiry Date and Country which I want to be automatically assigned to discrete columns.
    To make myself clearer I want access to automatically recognize a keyword on a web page. These keywords are the heads of the different columns of my acces table. In a way, I want access to recreate the web page as database with only specific parts (expertise, Expiry Date and Country) of the concerned web page.
    If there is, please indicate me a tutorial on the net.
    Thank you for your time

  2. #2
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    You'll need to download the web pace and parse the raw html code.

    example
    <table>
    <tr>
    <td>expertise</td>
    <td>Expiry Date</td>
    <td>Country</td>
    </tr>
    <tr>
    <td>Perl</td>
    <td>03/03/03</td>
    <td>USA</td>
    </tr>
    <tr>
    <td>Visual Basic</td>
    <td>03/21/03</td>
    <td>Canada</td>
    </tr>
    </table>

    You would need to search the file for certain tags (<Table>, <TR>) which indicate table, table rows, etc. Then search for your values.

    If you did not already understand this - then this may be beyond your ability. If so, I would recommend using tools that already do this for you. One example is http://www.awsystems.biz/products/htmlproducer/

    Search for
    MSHTML Parser
    HTML Table Parsing

    Here's a vb html code parser from planet-source-code.com
    http://www.planet-source-code.com/vb...=3125&lngWId=1

    Matt

  3. #3
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88
    Indeed I am a newbie!!!
    If I understand well, these code lines will help me to automatically search for keywords through HTML pages with access right?
    Thanks a lot
    NICOLAS

  4. #4
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Yes you can - here's a snippet:


    Set a reference to Microsoft HTML Object Library

    Place this in a click event. Have a text box named txtURL on the form. Paste a URL in the text box and click the button to execute the code.
    The source code will be printed in the immediate/debug window.

    Dim objLink As HTMLLinkElement
    Dim objMSHTML As New MSHTML.HTMLDocument
    Dim objDocument As MSHTML.HTMLDocument


    ' Must have Internet Explorer
    Set objDocument = objMSHTML.createDocumentFromUrl(Me!txtURL, vbNullString)

    While objDocument.readyState <> "complete"
    DoEvents
    Wend

    ' Source Code
    Debug.Print objDocument.documentElement.outerHTML



    -Matt

  5. #5
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88

    Set a reference to Microsoft HTML Object Library
    this means I have to have Visual Basic installed on my PC then?
    Is this version ok? : Microsoft Visual Basic Control Creation Edition
    Last edited by nicolascaprais; 04-16-03 at 13:01.

  6. #6
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Not sure if you need VB.

    I know you need IE > 5.0.

    Do you see "Microsoft HTML Object Library" as an available reference that you can choose?

  7. #7
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88
    I have IE 5.0
    is it a > version that's needed or a >= version?!!

  8. #8
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Sorry
    Greater or equal to version 5

    I believe that the Microsoft HTML Object Library - i.e. mshtml.tlb, is installed with Office 2k and XP. So you do not need VB.

  9. #9
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88

    Thumbs up

    thanks a lot!!!
    I will reinstall office on my PC.
    Then I guess I 'll have more questions, so I will come back on this thread soon!!
    thx 4 everything
    regards,
    nico

Posting Permissions

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