Help with vb / getting info from HTML
I need to be able to pull information from an html web site and pull that information into a Visual Basic App.
Such as pulling the Temperature off of the Noaa web site ??? any help Appreciated.
Web Development
I need to be able to pull information from an html web site and pull that information into a Visual Basic App.
Such as pulling the Temperature off of the Noaa web site ??? any help Appreciated.
by palmc
by bschaettle
You want to post the local temperature on your intranet?
You need to do a Google search on "screen scraping". Also look for "MSXML".
by bschaettle
OK, here's a solution using an Active Server Page that scrapes the temperature from Weather Underground:
-------------------------------------------
<%
Function CurrentTemperature(iZipCode)
Dim sHTML
Dim beginpos
Dim endpos
Dim srvXmlHttp
Dim URL
CurrentTemperature = "(not available)" ' default
Set srvXmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
URL= "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=" & iZipCode
srvXmlHttp.open "GET", URL, false
srvXmlHttp.send()
If srvXmlHttp.status = 200 Then
' grab the HTML source for the entire page
sHTML = srvXmlHttp.responseText
' find a tag that occurs just before the current temperature
beginpos = Instr(sHTML,"
Currently in Houston....
<% =CurrentTemperature(77001) %>
This discussion is closed to new replies.
Sort by Trending