|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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. 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. Show quoteHide quote "Boki" <bokit***@ms21.hinet.net> wrote in message news:OLbEztqYGHA.428@TK2MSFTNGP02.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. On Tue, 18 Apr 2006 13:46:29 +0800, Boki <bokit***@ms21.hinet.net>
wrote: Show quoteHide quote >Hi All, Don't know where you are, but if in the U.S. the NWS has several XML> >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. 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 gene kelley 寫é“:
Show quoteHide quote > On Tue, 18 Apr 2006 13:46:29 +0800, Boki <bokit***@ms21.hinet.net> I use InStr() to search WebBrowser1.DocumentText, could you please> 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 advice how to search the XML data tag? ( a better way than InStr() ).. Best regards, Boki. Boki,
To read an unknown xml document is this probably the easiest method http://www.vb-tips.com/default.aspx?ID=e788c048-e547-4de3-9c6a-22589f018cd4 I hope this helps, Cor "Boki" <bokit***@ms21.hinet.net> schreef in bericht gene kelley ??:news:1145347430.260286.251230@v46g2000cwv.googlegroups.com... Show quoteHide quote > On Tue, 18 Apr 2006 13:46:29 +0800, Boki <bokit***@ms21.hinet.net> I use InStr() to search WebBrowser1.DocumentText, could you please> 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 advice how to search the XML data tag? ( a better way than InStr() ).. Best regards, Boki.
Show quote
Hide quote
On 18 Apr 2006 01:03:50 -0700, "Boki" <bokit***@ms21.hinet.net> wrote: As noted in other responses, you would want to read the XML elements> >gene kelley ??? > >> On Tue, 18 Apr 2006 13:46:29 +0800, Boki <bokit***@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.DocumentText, could you please >advice how to search the XML data tag? ( a better way than InStr() ).. > >Best regards, >Boki. directly (XML Reader Class). Has nothing to do with a WebBrowser. Gene 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_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetWeather.Click Dim sr As IO.StreamReader Dim wc As New System.Net.WebClient Dim strUrl As String Dim strOut As String = "" strUrl = String.Format("http://xml.weather.yahoo.com/forecastrss?p={0}", txtZip.Text) Try sr = New IO.StreamReader(wc.OpenRead(strUrl)) Dim strHtml As String = sr.ReadToEnd Dim x As Integer = strHtml.IndexOf("<img src") Dim y As Integer = strHtml.IndexOf(")<br/>") strOut = strHtml.Substring(x, y - x + 6) sr.Close() Catch strOut = "<h1>Error getting weather</h1>" Finally WebBrowser1.DocumentText = strOut End Try End Sub Ken ----------------- Show quoteHide quote "Boki" <bokit***@ms21.hinet.net> wrote in message news:OLbEztqYGHA.428@TK2MSFTNGP02.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.
Show quote
Hide quote
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message Neat Ken!!! And works well.news:eL4I1LtYGHA.4752@TK2MSFTNGP02.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_Click(ByVal sender As System.Object, ByVal e > As System.EventArgs) Handles btnGetWeather.Click > Dim sr As IO.StreamReader > Dim wc As New System.Net.WebClient > Dim strUrl As String > Dim strOut As String = "" > strUrl = > String.Format("http://xml.weather.yahoo.com/forecastrss?p={0}", > txtZip.Text) > > Try > sr = New IO.StreamReader(wc.OpenRead(strUrl)) > Dim strHtml As String = sr.ReadToEnd > Dim x As Integer = strHtml.IndexOf("<img src") > Dim y As Integer = strHtml.IndexOf(")<br/>") > strOut = strHtml.Substring(x, y - x + 6) > sr.Close() > Catch > strOut = "<h1>Error getting weather</h1>" > Finally > WebBrowser1.DocumentText = strOut > End Try > End Sub > > Ken james (not the original poster, but, someone who appreciates interesting code!) "Boki" <bokit***@ms21.hinet.net> schrieb: Parsing an HTML file:> 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... 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.com/Community/UserSamples/Details.aspx?SampleGuid=B90FDDCE-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/>
devenv.exe CPU 100%
help with converting from VB4.0 Get table names from MSAccess Datasource Easy Q: 0.0 --> Output as string? Ubound() collection question Newbe help with Receive Serial Data Function PNG control graphic abnomality Store Item Template with Project Checking occurances in a txt/ini file |
|||||||||||||||||||||||