|
 |
asptoday_discuss thread: Microsoft.XMLHTTP get only half page! why?
Message #1 by "Shuren Wang" <shuren2002@y...> on Thu, 29 Nov 2001 18:22:54
|
|
Hi,
I write following asp page to retrieve data from Yahoo Weather.
however, it only get half page. why?
Does anybody can give me a help?
Thanks lots
Shuren
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<P>
<%
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://weather.yahoo.com/forecast/Montreal_CN_c.html",
false
xml.Send
Response.Write xml.responseText
%></P>
</BODY>
</HTML>
Message #2 by "Jason Salas" <jason@k...> on Fri, 30 Nov 2001 07:55:43 +1000
|
|
I copied your script and tried it on my machine and got the same thing.
Your code is OK...although you may want to add:
Set xml = Nothing
...to the end of your script for better memory management on your server to
close out the open object. Yahoo may be using some customied scripts or
components which deliver the other data on-the-fly. Let me play with this
some more and see if I can figure it out...
Jason
----- Original Message -----
From: "Shuren Wang" <shuren2002@y...>
To: "ASPToday Discuss" <asptoday_discuss@p...>
Sent: Thursday, November 29, 2001 6:22 PM
Subject: [asptoday_discuss] Microsoft.XMLHTTP get only half page! why?
> Hi,
>
> I write following asp page to retrieve data from Yahoo Weather.
> however, it only get half page. why?
>
> Does anybody can give me a help?
>
> Thanks lots
>
> Shuren
>
> <HTML>
> <HEAD>
> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> <TITLE></TITLE>
> </HEAD>
> <BODY>
>
> <P>
> <%
> Set xml = Server.CreateObject("Microsoft.XMLHTTP")
> xml.Open "GET", "http://weather.yahoo.com/forecast/Montreal_CN_c.html",
> false
> xml.Send
> Response.Write xml.responseText
> %></P>
>
> </BODY>
> </HTML>
$subst('Email.Unsub')
> Read the future with ebooks at B&N
>
http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid
=rn_ebooks
>
Message #3 by "Jason Salas" <jason@k...> on Fri, 30 Nov 2001 09:35:06 +1000
|
|
Shuren,
Do you need to parse the entire page for your app, or do you need only a
little bit of the information (i.e., the tempurature only)? If the latter
is true, you could do a screen scrape using the XMLHTTP object and
VBScript's RegExp object for regular expressions. You'd simply search
through the HTML of the remote page and extract a value.
Some good examples are at:
http://www.4guysfromrolla.com/webtech/102401-1.shtml
----- Original Message -----
From: "Shuren Wang" <shuren2002@y...>
To: "ASPToday Discuss" <asptoday_discuss@p...>
Sent: Thursday, November 29, 2001 6:22 PM
Subject: [asptoday_discuss] Microsoft.XMLHTTP get only half page! why?
> Hi,
>
> I write following asp page to retrieve data from Yahoo Weather.
> however, it only get half page. why?
>
> Does anybody can give me a help?
>
> Thanks lots
>
> Shuren
>
> <HTML>
> <HEAD>
> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> <TITLE></TITLE>
> </HEAD>
> <BODY>
>
> <P>
> <%
> Set xml = Server.CreateObject("Microsoft.XMLHTTP")
> xml.Open "GET", "http://weather.yahoo.com/forecast/Montreal_CN_c.html",
> false
> xml.Send
> Response.Write xml.responseText
> %></P>
>
> </BODY>
> </HTML>
$subst('Email.Unsub')
> Read the future with ebooks at B&N
>
http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid
=rn_ebooks
>
|
|
 |