Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-10-2012, 06:36 PM   PM User | #1
weaksauce
New Coder

 
Join Date: Nov 2007
Posts: 34
Thanks: 9
Thanked 0 Times in 0 Posts
weaksauce is an unknown quantity at this point
javascript or jquery select text without proper html tags

I'm trying to use a poorly designed rss feed from weather bug for a website. I'm trying to retrieve the information to put in an already styled widget.

The RSS i have parsed is:
PHP Code:
<div>
<
img src="http://deskwx.weatherbug.com/images/Forecast/icons/cond999.gif" border="0" alt="" width="50" height="42"/>&nbsp;&nbsp;&nbsp;
<
b>Unknown</b> <br />
<
b>Temperature:</b50.4 &deg;F<br />
<
b>Humidity:</b81 %&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Dew Point:</b45? &deg;<br />
<
b>Wind Speed:</b5 mph W &nbsp;&nbsp; <b>Gusts:</b18 mph WSW<br />
<
b>Pressure:</b29.95 &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>Rain Today:</b0.00 &quot;<br />
</
div
I basically need to select and extract:
temperature, rain chance, pressure, wind speed, gusts, dew point, and humidity...

I've tried doing selecting all the <b> tags but I don't know how to get the nex text node after the closing b tag.

Any help will greatly be appreciated.
__________________
Time after Time

Last edited by weaksauce; 10-10-2012 at 08:52 PM..
weaksauce is offline   Reply With Quote
Old 10-10-2012, 07:02 PM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
can you provide the link to the rss feed? It may be easier dealing directly with the output
xelawho is offline   Reply With Quote
Old 10-10-2012, 07:27 PM   PM User | #3
weaksauce
New Coder

 
Join Date: Nov 2007
Posts: 34
Thanks: 9
Thanked 0 Times in 0 Posts
weaksauce is an unknown quantity at this point
http://feeds.weatherbug.com/rss.aspx...rr&zcode=z4641
__________________
Time after Time
weaksauce is offline   Reply With Quote
Old 10-10-2012, 08:52 PM   PM User | #4
weaksauce
New Coder

 
Join Date: Nov 2007
Posts: 34
Thanks: 9
Thanked 0 Times in 0 Posts
weaksauce is an unknown quantity at this point
I was able to find an API and use JSON to retrieve the data instead.

http://developer.weatherbug.com/docs...erBug_API_JSON
__________________
Time after Time
weaksauce is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:39 PM.


Advertisement
Log in to turn off these ads.