I am trying to grab data from 4 different URLs so that PDA users (using ASP/VBScript). I then want to parse the data I grab and place it into a text file. I have tried just about everything. Here is my code, as an example:
<%@ language = VBScript %>
<%
Dim url 'The URL to download
Dim inet 'Object for Inet Control
Dim sHTML 'String to hold HTML from download
Dim rStockSymbol 'var to hold regular expression
Dim objCols 'Object to hold collections from Regular expression
Dim sStockSymbol 'string to hold the stock symbol
Dim objMatch 'Object for matches
url = "
'Create instance of Inet Control
Set inet = Server.CreateObject("InetCtls.Inet"
'Set the timeout property
inet.RequestTimeOut = 60
inet.AccessType = 2'icNamedProxy
inet.Proxy = "dbdm.company.com:8080"
inet.Protocol = 4'icHTTP
inet.RemotePort = 80
'Set the URL property of the control
inet.Url = url
'Actually download the file
sHTML = inet.OpenURL()
'Regular expression to find the string stored between
'the <b><center>last: tags. This is where the stock symbol is stored.
Set rStockSymbol = New regexp
rStockSymbol.Pattern = "<b><center>(class=""charthdr""</b></center>"
rStockSymbol.Global = False
rStockSymbol.IgnoreCase = True
'Execute the regular expression on the raw HTML
Set objCols = rStockSymbol.Execute( sHTML )
'Step through our matches
For Each objMatch in objCols
sStockSymbol = sStockSymbol & objMatch.Value
Next
'Clean up
Set rStockSymbols = Nothing
Set objCols = Nothing
'Strip the <b><center>last: tags off of the stock symbol
sStockSymbol = Replace(Replace(StockSymbol, "<b><center>last:", "", "</b><center>last:", ""
%>
<HTML>
<HEAD>
<TITLE>Microsoft Stock Symbol Retrieval</TITLE>
</HEAD>
<BODY>
<P>Here is the Microsoft Stock Symbol: <%=sStockSymbol%></P>
</BODY>
</HTML>
What in the world do I need to do now?
Sherry
Technical Writer/WebMaster/Developer
<%@ language = VBScript %>
<%
Dim url 'The URL to download
Dim inet 'Object for Inet Control
Dim sHTML 'String to hold HTML from download
Dim rStockSymbol 'var to hold regular expression
Dim objCols 'Object to hold collections from Regular expression
Dim sStockSymbol 'string to hold the stock symbol
Dim objMatch 'Object for matches
url = "
'Create instance of Inet Control
Set inet = Server.CreateObject("InetCtls.Inet"
'Set the timeout property
inet.RequestTimeOut = 60
inet.AccessType = 2'icNamedProxy
inet.Proxy = "dbdm.company.com:8080"
inet.Protocol = 4'icHTTP
inet.RemotePort = 80
'Set the URL property of the control
inet.Url = url
'Actually download the file
sHTML = inet.OpenURL()
'Regular expression to find the string stored between
'the <b><center>last: tags. This is where the stock symbol is stored.
Set rStockSymbol = New regexp
rStockSymbol.Pattern = "<b><center>(class=""charthdr""</b></center>"
rStockSymbol.Global = False
rStockSymbol.IgnoreCase = True
'Execute the regular expression on the raw HTML
Set objCols = rStockSymbol.Execute( sHTML )
'Step through our matches
For Each objMatch in objCols
sStockSymbol = sStockSymbol & objMatch.Value
Next
'Clean up
Set rStockSymbols = Nothing
Set objCols = Nothing
'Strip the <b><center>last: tags off of the stock symbol
sStockSymbol = Replace(Replace(StockSymbol, "<b><center>last:", "", "</b><center>last:", ""
%>
<HTML>
<HEAD>
<TITLE>Microsoft Stock Symbol Retrieval</TITLE>
</HEAD>
<BODY>
<P>Here is the Microsoft Stock Symbol: <%=sStockSymbol%></P>
</BODY>
</HTML>
What in the world do I need to do now?
Sherry
Technical Writer/WebMaster/Developer