473,569 Members | 2,845 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weather board, how to get html data.

Hi All,

I am going to create a personal weather board.

It is easy to show the picutre on website ( just link the picture to
picturesbox's properties )

but I dont' know how to add some other text near by..

for example:

I can get the weather icon, but I don't know how to get the description
text...

What should I do?

Best regards,
Boki.
Apr 18 '06 #1
9 3892
Depends if you are talking about text adjacent to the picture or Alernate
text, iether way you will need to scrape the site and parse the text. Seach
for web scraping on google.

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Boki" <bo******@ms21. hinet.net> wrote in message
news:OL******** *****@TK2MSFTNG P02.phx.gbl...
Hi All,

I am going to create a personal weather board.

It is easy to show the picutre on website ( just link the picture to
picturesbox's properties )

but I dont' know how to add some other text near by..

for example:

I can get the weather icon, but I don't know how to get the description
text...

What should I do?

Best regards,
Boki.

Apr 18 '06 #2
On Tue, 18 Apr 2006 13:46:29 +0800, Boki <bo******@ms21. hinet.net>
wrote:
Hi All,

I am going to create a personal weather board.

It is easy to show the picutre on website ( just link the picture to
picturesbox' s properties )

but I dont' know how to add some other text near by..

for example:

I can get the weather icon, but I don't know how to get the description
text...

What should I do?

Best regards,
Boki.


Don't know where you are, but if in the U.S. the NWS has several XML
feeds which make it very easy to use directly in a app. Here is a
current observation example:
http://www.weather.gov/data/current_obs/KSFO.xml

Gene
Apr 18 '06 #3

gene kelley 寫道:
On Tue, 18 Apr 2006 13:46:29 +0800, Boki <bo******@ms21. hinet.net>
wrote:
Hi All,

I am going to create a personal weather board.

It is easy to show the picutre on website ( just link the picture to
picturesbox' s properties )

but I dont' know how to add some other text near by..

for example:

I can get the weather icon, but I don't know how to get the description
text...

What should I do?

Best regards,
Boki.


Don't know where you are, but if in the U.S. the NWS has several XML
feeds which make it very easy to use directly in a app. Here is a
current observation example:
http://www.weather.gov/data/current_obs/KSFO.xml

Gene


I use InStr() to search WebBrowser1.Doc umentText, could you please
advice how to search the XML data tag? ( a better way than InStr() )..

Best regards,
Boki.

Apr 18 '06 #4
Boki,

To read an unknown xml document is this probably the easiest method

http://www.vb-tips.com/default.aspx?...a-22589f018cd4

I hope this helps,

Cor

"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** **************@ v46g2000cwv.goo glegroups.com.. .

gene kelley ??:
On Tue, 18 Apr 2006 13:46:29 +0800, Boki <bo******@ms21. hinet.net>
wrote:
Hi All,

I am going to create a personal weather board.

It is easy to show the picutre on website ( just link the picture to
picturesbox' s properties )

but I dont' know how to add some other text near by..

for example:

I can get the weather icon, but I don't know how to get the description
text...

What should I do?

Best regards,
Boki.


Don't know where you are, but if in the U.S. the NWS has several XML
feeds which make it very easy to use directly in a app. Here is a
current observation example:
http://www.weather.gov/data/current_obs/KSFO.xml

Gene


I use InStr() to search WebBrowser1.Doc umentText, could you please
advice how to search the XML data tag? ( a better way than InStr() )..

Best regards,
Boki.
Apr 18 '06 #5
Hi,

I have used the yahoo weather rss for this. They have a
weather sticker embedded in it. The address for the rss feed has a
querystring for getting the weather. In the us use your zipcode for getting
the weather. This example requires a textbox (txtZip) for entering in a
zipcode to get the weather for, webbrowser control to display the weather
sticker, and a button (btnGetWeather) .

Private Sub btnGetWeather_C lick(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnGetWeather.C lick
Dim sr As IO.StreamReader
Dim wc As New System.Net.WebC lient
Dim strUrl As String
Dim strOut As String = ""
strUrl =
String.Format(" http://xml.weather.yah oo.com/forecastrss?p={ 0}", txtZip.Text)

Try
sr = New IO.StreamReader (wc.OpenRead(st rUrl))
Dim strHtml As String = sr.ReadToEnd
Dim x As Integer = strHtml.IndexOf ("<img src")
Dim y As Integer = strHtml.IndexOf (")<br/>")
strOut = strHtml.Substri ng(x, y - x + 6)
sr.Close()
Catch
strOut = "<h1>Error getting weather</h1>"
Finally
WebBrowser1.Doc umentText = strOut
End Try
End Sub

Ken
-----------------
"Boki" <bo******@ms21. hinet.net> wrote in message
news:OL******** *****@TK2MSFTNG P02.phx.gbl...
Hi All,

I am going to create a personal weather board.

It is easy to show the picutre on website ( just link the picture to
picturesbox's properties )

but I dont' know how to add some other text near by..

for example:

I can get the weather icon, but I don't know how to get the description
text...

What should I do?

Best regards,
Boki.

Apr 18 '06 #6
"Boki" <bo******@ms21. hinet.net> schrieb:
I am going to create a personal weather board.

It is easy to show the picutre on website ( just link the picture to
picturesbox's properties )

but I dont' know how to add some other text near by..

for example:

I can get the weather icon, but I don't know how to get the description
text...


Parsing an HTML file:

MSHTML Reference
<URL:http://msdn.microsoft. com/library/default.asp?url =/workshop/browser/mshtml/reference/reference.asp>

- or -

..NET Html Agility Pack: How to use malformed HTML just like it was
well-formed XML...
<URL:http://blogs.msdn.com/smourier/archive/2003/06/04/8265.aspx>

Download:

<URL:http://www.codefluent. com/smourier/download/htmlagilitypack .zip>

- or -

SgmlReader 1.4
<URL:http://www.gotdotnet.c om/Community/UserSamples/Details.aspx?Sa mpleGuid=B90FDD CE-E60D-43F8-A5C4-C3BD760564BC>

If the file read is in XHTML format, you can use the classes contained in
the 'System.Xml' namespace for reading information from the file.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 18 '06 #7

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:eL******** ******@TK2MSFTN GP02.phx.gbl...
Hi,

I have used the yahoo weather rss for this. They have a
weather sticker embedded in it. The address for the rss feed has a
querystring for getting the weather. In the us use your zipcode for
getting the weather. This example requires a textbox (txtZip) for entering
in a zipcode to get the weather for, webbrowser control to display the
weather sticker, and a button (btnGetWeather) .

Private Sub btnGetWeather_C lick(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnGetWeather.C lick
Dim sr As IO.StreamReader
Dim wc As New System.Net.WebC lient
Dim strUrl As String
Dim strOut As String = ""
strUrl =
String.Format(" http://xml.weather.yah oo.com/forecastrss?p={ 0}",
txtZip.Text)

Try
sr = New IO.StreamReader (wc.OpenRead(st rUrl))
Dim strHtml As String = sr.ReadToEnd
Dim x As Integer = strHtml.IndexOf ("<img src")
Dim y As Integer = strHtml.IndexOf (")<br/>")
strOut = strHtml.Substri ng(x, y - x + 6)
sr.Close()
Catch
strOut = "<h1>Error getting weather</h1>"
Finally
WebBrowser1.Doc umentText = strOut
End Try
End Sub

Ken

Neat Ken!!! And works well.
james

(not the original poster, but, someone who appreciates interesting code!)
Apr 18 '06 #8
You can try SWExplorerAutom ation (http:\\webunit testing.com).

Apr 18 '06 #9
On 18 Apr 2006 01:03:50 -0700, "Boki" <bo******@ms21. hinet.net> wrote:

gene kelley ???
On Tue, 18 Apr 2006 13:46:29 +0800, Boki <bo******@ms21. hinet.net>
wrote:
>Hi All,
>
>I am going to create a personal weather board.
>
>It is easy to show the picutre on website ( just link the picture to
>picturesbox' s properties )
>
>but I dont' know how to add some other text near by..
>
>for example:
>
>I can get the weather icon, but I don't know how to get the description
>text...
>
>What should I do?
>
>Best regards,
>Boki.


Don't know where you are, but if in the U.S. the NWS has several XML
feeds which make it very easy to use directly in a app. Here is a
current observation example:
http://www.weather.gov/data/current_obs/KSFO.xml

Gene


I use InStr() to search WebBrowser1.Doc umentText, could you please
advice how to search the XML data tag? ( a better way than InStr() )..

Best regards,
Boki.


As noted in other responses, you would want to read the XML elements
directly (XML Reader Class). Has nothing to do with a WebBrowser.

Gene
Apr 19 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2157
by: futureofphp | last post by:
Hi I am having a PHP based intranet home page. How can I add local weather forecast for the day to it? Is there any free weather forevast providers? I am interested in the local weather of Europe. I found www.wunderground.com its not that good, the banner does not look impressive, something like CNN or BBC is cool. Thanks
0
1497
by: Jeremy Jones | last post by:
is looking for two software developers to develop tests (written in Python) to test our internally developed applications for the cable tier. There is a reference to the job on the Python Job Board (http://www.python.org/Jobs.html). Anyone interested can email me at zanesdad at bellsouth dot net or jmjones at weather dot com. Jeremy...
1
2551
by: pmclinn | last post by:
I have the xml feed belowfrom this link: http://www.weather.gov/alerts/ct.rss I for the life of me can not get this data to format in a html table using client side scripting. Any help would be much appreciated. <?xml version="1.0" encoding="UTF-8" ?> - <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> - <channel>...
0
1590
by: jimb | last post by:
Looking for a simple view on the weather. Just learning the xml stuff. I would like to add to the the weather.com icon. Any help is appreciated. <html> <head> <body bgcolor="#000000" text="#FFFFFF"> <p class=MsoNormal><o:p></o:p><span style='font-size:288.0pt;font-family:Arial'>
3
3814
by: dawnrager | last post by:
Hi, everyone. I'm having a really difficult time pasting in generated code from the Weather Channel for a weather sticker for my webpage. This was the code sent to me via email: <!-- cut and paste the below code into your HTML editor --><div id="wx_module_2384"> <a href="http://www.weather.com/weather/local/15904">Johnstown, PA (15904)...
2
2074
by: sandeep patil | last post by:
how to diplay the weather condiction on my webpage suppose i want to read weather from www.bbc.co.uk/weather.html how i can read it usin program
2
2431
by: seancron | last post by:
Does anybody have any suggestions for getting started on desigining a desktop weather application in Python? I've been looking for access to weather data and while I have found several including the weather.com service I've decided to use the Yahoo! Rss Weather feed since it doesn't have a license like the weather.com service does. However...
4
11376
by: shaynenash | last post by:
I wrote this script to calculate if water restrictions were in place if it was hotter than 25deg C. It has turned out to be a pretty good weather widget that can be used elsewhere. This was initially written for Northern Midlands Council in Tasmania, Australia. I wrote this for Internet explorer and haven't tested it elsewhere. It would probably...
2
2854
by: Craig M | last post by:
Our current intranet site displays the weather with a 7 day forecast. We have to manually enter all the weather info into a SQL DB using a web front end, but would like to use an RSS feed. All of the feeds I've found on the web are only 2-3 day forecast. Does anyone know if there are any RSS weather feeds with a 7 day forecast? Or any...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.