parse http data from website
Posted: Thu Jan 24, 2019 7:33 pm
Hi,
I am following an example from here:
https://techtutorialsx.com/2017/05/19/e ... -requests/
and trying to parse temperature value from a website such as https://www.wunderground.com.
I understand I should be using API for this project but I am looking to make it work using regular html payload.
Basically, I am trying to extract '43' temperature which is listed after Temperature table cell.
It's not JSON so I am looking for a way to search the payload residing in int httpCode = http.GET(); and only get temperature value.
Thanks all
Here is more of payload data
I am following an example from here:
https://techtutorialsx.com/2017/05/19/e ... -requests/
and trying to parse temperature value from a website such as https://www.wunderground.com.
I understand I should be using API for this project but I am looking to make it work using regular html payload.
Basically, I am trying to extract '43' temperature which is listed after Temperature table cell.
It's not JSON so I am looking for a way to search the payload residing in int httpCode = http.GET(); and only get temperature value.
Code: Select all
<tr><td>Temperature</td>
<td>
<span class="nowrap"><b>43</b>°F</span>
</td>
</tr>[Codebox=html5 file=Untitled.html][/Codebox]
Thanks all
Here is more of payload data
Code: Select all
<table><tr><td> <center>
<table border="1" width="100%">
<tr><td colspan="2" ><a name="conditions"></a>
Updated: <b>1:35 PM </b><br />Observed at
<b></b>
</td></tr>
<tr><td>Temperature</td>
<td>
<span class="nowrap"><b>43</b>°F</span>
</td>
</tr>
<tr><td>Windchill</td>
<td>
<span class="nowrap"><b>34</b>°F</span>
</td></tr>
<tr><td>Humidity</td>
<td><b>93%</b></td></tr>
<tr><td>Dew Point</td>
<td>
<span class="nowrap"><b>41</b>°F</span>
</td></tr>
<tr><td>Wind</td>
<td>
<b>NW</b> at
<span class="nowrap"><b>23</b> mph</span>
</td></tr>
<tr>
<td>Wind Gust</td>
<td>
<span class="nowrap"><b>30</b> mph</span>
</td>
</tr>
<tr><td>Pressure</td>
<td>
<span class="nowrap"><b>29.52</b> in</span>
<b>(Falling)</b>
</td></tr>
<tr><td>Conditions</td>
<td><b>Light Rain</b></td></tr>
<tr><td>Visibility</td>
<td>
<span class="nowrap"><b>10.0</b> miles</span>
</td></tr>
<tr>
<td>UV</td>
<td>1 out of 16</td>
</tr>
<tr><td>Clouds</td>
<td>
<b>Mostly Cloudy</b>
(BKN)
:
<span class="nowrap"><b>1600</b> ft</span>
<br />
<b>Mostly Cloudy</b>
(BKN)
:[Codebox=html4strict file=Untitled.html][/Codebox]