I want to capture the text created by a web page.
Here is the page I am looking at http://www.metoffice.gov.gg/livedata.html
The data I want is things like the temperature, wind speed etc. The HTML does not seem to contain any of the displayed data.
I have looked at WebView which displays the page perfectly, I just can't see how to get at the displayed data.
Capture text created by HTML
Re: Capture text created by HTML
It looks like the data is is two frames not in the main page html
hth
b
hth
b
- BruceSteers
- Posts: 1972
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Capture text created by HTML
Yep , what he said.
it's here..
so you want to load
http://www.metoffice.gov.gg/met/PA50.html
and
http://www.metoffice.gov.gg/met/wind2.html
then extract the data from the tables
wind2.html looks like this..
it's here..
Code: Select all
<iframe id="temp"
src="http://www.metoffice.gov.gg/met/PA50.html" height ="100%" width ="100%" frameborder="0" scrolling="no" allowtransparency="true" background="none">
</iframe>
</div>
<div class="Live1">
<iframe id="wind"
src="http://www.metoffice.gov.gg/met/wind2.html" height ="100%" width="100%" frameborder="0" scrolling="no">
</iframe>
http://www.metoffice.gov.gg/met/PA50.html
and
http://www.metoffice.gov.gg/met/wind2.html
then extract the data from the tables
wind2.html looks like this..
Code: Select all
<html><META HTTP-EQUIV=REFRESH CONTENT=30; URL=http://wind2.html><link href="stylewind.css" type="text/css" rel="stylesheet"><body leftmargin=15><div align=center><center><table><tr><td width=224 height=150 align=center><div align=left><table border=0><tr><td width=219 height=50><font size=4> Mean Direction (°T)</font></td></tr><tr><td width=219 height=50><font size=4> Mean Wind Speed (knots)</font></td></tr><tr><td width=219 height=50><font size=4> 10 min. Highest Gust (knots)</font></td></tr><tr><td width=219 height=50><font size=4> 60 min. Highest Gust (knots)</font></td></tr></table></div></td><td width=118 height=150 align=center><div align=center><center><table border=0 align=left><tr><td height=50 align=center valign=middle width=47><font size=4>340</font></td><td width=60 height=50 align=center valign=middle><font size=3>NNW</font></td></tr><tr><td width=47 height=50 align=center valign=middle><font size=4>6</font></td><td width=60 height=50 align=center valign=middle>force 2</td></tr><tr><td width=47 height=50 align=center valign=middle><font size=4>8</font></td><td width=60 height=50 align=center valign=middle><font size=3>9 mph</font></td></tr><tr><td width=47 height=50 align=center valign=middle><font size=4>8</font></td><td width=60 height=50 align=center valign=middle><font size=3>9 mph</font></td></tr></table></center></div></td></tr></table></center></div><p align=center><font size=3>Updated: 11:48GMT Sunday 29 December 2024</font></p></body></html>
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1179
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Capture text created by HTML
Well done Bruce, you're a star! I'll have a go at that.
- BruceSteers
- Posts: 1972
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Capture text created by HTML
I has a little play and did this for wind2.html
it's only issue it the "degrees" sign in "Mean Direction (°T)" i could not convert that.
it makes a String[][] array
[title, data1, data2]
[title, data1, data2]
it's only issue it the "degrees" sign in "Mean Direction (°T)" i could not convert that.
it makes a String[][] array
[title, data1, data2]
[title, data1, data2]
- Attachments
-
- Untitled.png (65.47 KiB) Viewed 1905 times
-
- _aa-0.0.1.tar.gz
- (8.01 KiB) Downloaded 141 times
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1179
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Capture text created by HTML
Thanks for the program. I cheated a bit on the HTML clean up by shelling to html2text. Here is my effort so far. VERY early days....