Results 1 to 2 of 2

Thread: ASP parser and recordset

  1. #1
    Join Date
    Sep 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default ASP parser and recordset

    Hi,
    I develop in asp a html page parser, and I would need some help.

    Here is my code:
    Code:
    <%
    Dim objXmlHttp
    Dim strHTML
    Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
    objXmlHttp.open "GET", "http://somepage", False
    objXmlHttp.send
    strHTML = objXmlHttp.responseText
    %>
    Everything works fine, and the result is:
    Code:
    <table>
    <tr>
    <td>EUR</td>
    <td>4.23</td>
    </tr>
    <tr>
    <td>USD</td>
    <td>4.19</td>
    </tr>
    <tr>
    <td>AUD</td>
    <td>4.20</td>
    </tr>
    <tr>
    <td>NEZ</td>
    <td>4.13</td>
    </tr>
    </table>
    Now what I need to do is: for EUR and USD only to insert the values into a database. Practically based on tr,td i need that first td in the tr to be the currency and the second td the value and then these to be inserted into a table in the database.

    Please help!
    Thank you

  2. #2
    Join Date
    Feb 2011
    Posts
    16
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    --replace end-of-line characters with "nothing"

    --replace "</td><td>" with ":"

    --replace "</td></tr>" with "-"

    http://www.w3schools.com/Vbscript/func_replace.asp


    --strip off the html with this method

    http://www.4guysfromrolla.com/webtech/100199-1.shtml

    -- parse/retrieve desired values with split function

    http://www.w3schools.com/VBscript/func_split.asp

    --add values to database

    http://www.w3schools.com/ado/ado_add.asp

Bookmarks

Posting Permissions

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