Log in

View Full Version : Parsing HTML and Listing Information in a Drop Down Menu



hunter21188
03-31-2016, 04:57 PM
Alright, so I really have no idea where to begin with this task I want to accomplish. I need to import an html file (at a particular URL) that has the following code (note - this URL will contain multiple <entry></entry> sections. Only one is shown below as an example.):


<entry>
<id>http://alerts.weather.gov/cap/wwacapget.php?x=MS1255F16198D4.SevereThunderstormWarning.1255F161BCC4MS.JAN SVRJAN.cec4abc4925ffba8bbf81c69af18a8a2</id>
<updated>2016-03-31T17:53:00-05:00</updated>
<published>2016-03-31T17:53:00-05:00</published>
<author>
<name>w-nws.webmaster@noaa.gov</name>
</author>
<title>Severe Thunderstorm Warning issued March 31 at 5:53PM CDT until March 31 at 6:45PM CDT by NWS</title>
<link href="http://alerts.weather.gov/cap/wwacapget.php?x=MS1255F16198D4.SevereThunderstormWarning.1255F161BCC4MS.JAN SVRJAN.cec4abc4925ffba8bbf81c69af18a8a2"/>
<summary>THE NATIONAL WEATHER SERVICE IN JACKSON HAS ISSUED A * SEVERE THUNDERSTORM WARNING FOR... CENTRAL LOWNDES COUNTY IN NORTHEASTERN MISSISSIPPI... * UNTIL 645 PM CDT * AT 553 PM CDT...A SEVERE THUNDERSTORM WAS LOCATED NEAR BENT OAK... OR 8 MILES SOUTHWEST OF COLUMBUS...MOVING NORTHEAST AT 40 MPH.</summary>
<cap:event>Severe Thunderstorm Warning</cap:event>
<cap:effective>2016-03-31T17:53:00-05:00</cap:effective>
<cap:expires>2016-03-31T18:45:00-05:00</cap:expires>
<cap:status>Actual</cap:status>
<cap:msgType>Alert</cap:msgType>
<cap:category>Met</cap:category>
<cap:urgency>Immediate</cap:urgency>
<cap:severity>Severe</cap:severity>
<cap:certainty>Observed</cap:certainty>
<cap:areaDesc>Lowndes</cap:areaDesc>
<cap:polygon>33.39,-88.29 33.31,-88.54 33.45,-88.6 33.53,-88.49 33.52,-88.48 33.53,-88.47 33.54,-88.48 33.55,-88.47 33.7,-88.26 33.39,-88.29</cap:polygon>
<cap:geocode>
<valueName>FIPS6</valueName>
<value>028087</value>
<valueName>UGC</valueName>
<value>MSC087</value>
</cap:geocode>
<cap:parameter>
<valueName>VTEC</valueName>
<value>/O.NEW.KJAN.SV.W.0189.160331T2253Z-160331T2345Z/</value>
</cap:parameter>
</entry>

I need to go through all the <entry></entry> tags and find every one that has "KJAN" within the <value></value> tags.

After this, the drop down menu would then display "KJAN.SV.W.0188" (This is also located within the <value> tags, and would always come after "O.NEW."), for example. This would be displayed for every entry that matches the KJAN criteria listed above.

Any ideas?

Thank you!