Retrieving a Web Page with XMLHTTP

R

RHPT

I would like to retrieve a remote URL using the XMLHTTP object.
However, I only want to "display" a certain portion of the page. How
can I go about doing this?


Thank you!
 
A

AlanM

RHPT said:
I would like to retrieve a remote URL using the XMLHTTP object.
However, I only want to "display" a certain portion of the page. How
can I go about doing this?


Thank you!


once you have the stream, you need to search for parts of the code, and make
a substing.
I have included authentication ,"server\user","password" , you may not need
this


url = http://www.abc.net.au/news/topstories.htm
dim xmlhttpABC
set xmlhttpABC = Server.CreateObject("MSXML2.Serverxmlhttp")
xmlhttpABC.open "GET", url, false ,"server\user","password"
xmlhttpABC.send ""
tex3 = xmlhttpABC.responsetext
lookFor = "START HEADLINE/FIRST PAR COLUMN"
andFor = "END HEADLINE/FIRST PAR COL"
st = InStr(1,tex3,lookFor)
ed = InStr(st,tex3,andFor)
set xmlhttpABC = nothing

response.write mid(tex3,st,(ed-st) )
 
R

RHPT

That worked great. Thanks!



:
::>I would like to retrieve a remote URL using the XMLHTTP object.
:> However, I only want to "display" a certain portion of the page. How
:> can I go about doing this?
:>
:>
:> Thank you!
:>
:
:
:eek:nce you have the stream, you need to search for parts of the code, and make
:a substing.
:I have included authentication ,"server\user","password" , you may not need
:this
:
:
:url = http://www.abc.net.au/news/topstories.htm
:dim xmlhttpABC
:set xmlhttpABC = Server.CreateObject("MSXML2.Serverxmlhttp")
:xmlhttpABC.open "GET", url, false ,"server\user","password"
:xmlhttpABC.send ""
:tex3 = xmlhttpABC.responsetext
:lookFor = "START HEADLINE/FIRST PAR COLUMN"
:andFor = "END HEADLINE/FIRST PAR COL"
:st = InStr(1,tex3,lookFor)
:ed = InStr(st,tex3,andFor)
:set xmlhttpABC = nothing
:
:response.write mid(tex3,st,(ed-st) )
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,147
Messages
2,570,835
Members
47,382
Latest member
MichaleStr

Latest Threads

Top