Capture text created by HTML

Post

Posted
Rating:
#1 (In Topic #1394)
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
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.
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
thatbruce is in the usergroup ‘Regular’
 It looks like the data is is two frames not in the main page html
hth
b

Online now: No Back to the top

Post

Posted
Rating:
#3
Banned
Yep , what he said.

it's here..

Code

<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>

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..

Code

<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>&nbsp;Mean Direction (°T)</font></td></tr><tr><td width=219 height=50><font size=4>&nbsp;Mean Wind Speed (knots)</font></td></tr><tr><td width=219 height=50><font size=4>&nbsp;10 min. Highest Gust (knots)</font></td></tr><tr><td width=219 height=50><font size=4>&nbsp;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>
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
Well done Bruce, you're a star! I'll have a go at that.  :D
Online now: No Back to the top

Post

Posted
Rating:
#5
Banned
 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]

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
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….

<IMG src="https://www.cogier.com/gambas/GsyWeather.png"> </IMG>

Attachment
Online now: No Back to the top
1 guest and 0 members have just viewed this.