Reading external HTML page into a variable

Results 1 to 2 of 2

Thread: Reading external HTML page into a variable

  1. #1
    Join Date
    Dec 1969

    Default Reading external HTML page into a variable

    I&#039;m trying to load an HTML page that is not on my webserver into a variable on my ASP page. I want to then parse the HTML page so I can get some information on it and then display this information on my own ASP page. For example, my webpage at wants to display some UPS tracking information from . I just want to load the entire contents of the page into a variable on my ASP page then parse out the information I need and display it in my own custom format. I don&#039;t want the user to ever see the page. The FileSystemObject seemed like a good choice until I realized you can only open a file on your own server or a server you have the absolute path. I don&#039;t know the physical path on the server. I wanted to do something like this but it won&#039;t work:<BR><BR>Dim objFSO<BR>Set objFSO = Server.CreateObject("Scripting.FileSystemObject")< BR><BR>&#039;Open the text file<BR>Dim objTextStream<BR>Set objTextStream = objFSO.OpenTextFile("", fsoForReading) &#060;--This line will NOT work.<BR><BR>Any suggestions would be much appreciated! BTW - I&#039;m hosted on a shared platform so I cannot load any DLL&#039;s or COM components that require registration to do the job -- I think I&#039;m stuck with VB script or JavaScript.<BR><BR>Thanks!!<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Reading external HTML page into a variable

    Something like this:<BR>&#060;%<BR>xml = Server.CreateObject("Microsoft.XMLHTTP") <BR>xml.Open ("GET", "", 0) <BR>xml.Send(strPostData)<BR>Page = xml.responseText<BR>xml = Nothing <BR>%&#062;<BR><BR>Btw. this might not be legal.

Posting Permissions

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