
02-02-2006, 07:31 AM
|
 |
SEO
|
|
Join Date: May 2005
Location: England, UK
Posts: 621

|
|
Answer - works in ASP
Hello!
I have the answer, but it's an ASP based solution. You could convert it to javascript though, without too much trouble.
In the following code sample, i'll assume the remote url is:
http://www.example.com/somepage.htm
Code:
URL = "http://www.example.com/somepage.htm"
Dim objXMLHTTP
Set objXMLHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
objXMLHTTP.Open "GET", URL, False
objXMLHTTP.Send
IF objXMLHTTP.statusText = "OK" THEN
html = lcase(objXMLHTTP.responseText)
TheStart = InStr(1, html, "name=" & CHR(34) & "PriceSell3" & CHR(34)) + 25
TheEnd = InStr(TheStart, html, CHR(34))
Length = TheEnd - TheStart
GotValue= float(Mid(html,TheStart,Length))
END IF
Set objXMLHTTP = nothing
So, having got the value you want into your variable "GotValue", it's up to you what you want to do with it?
This solution doesn't involve any security context issues whatsoever. It retrieves the html source of the page using XML, which we can then work with as a text stream.
Easy!
Last edited by BSolveIT : 02-02-2006 at 12:55 PM.
|