android - How to get data from html page using java? -
how data xml/html page?
i'd make android app, in users notification of school-lesson fell out. website looks like: http://www.anony.ws/image/pc9
users fill in school class (klas) after installation of app. want pick data table, users should receive notification if it's class. (example:
if ( userclass == klas ), alert ("hey, " + + " " + + "because of" + opmerking);
something that. have no idea how should pick data out of table, it's weird page. makes more difficult because page fades (1/2) (2/2) (max 10 listings each page, 50 listings = 5 pages) , find out example here: http://suse.ghlyceum.nl/dagrooster/lwoo/. how should pick data , put them in java vars!
example code need pick things out
<tr class='list odd'> <td class="list" align="center">6v</td> <td class="list" align="center">5</td> <td class="list" align="center">fatl1</td> <td class="list" align="center">fatl1</td> <td class="list" align="center">mps</td> <td class="list" align="center">mps</td> <td class="list" align="center">d03</td> <td class="list" align="center">lokaal wissel</td>
full website code:
<html> <head> <title>roosterwijzigingen locatie rijnwoude</title> <meta http-equiv="expires" content="0"> <style type="text/css"> <!-- /* page title */ div.mon_title { font-weight: bold; font-size: larger; } table.info { background-color: #ffb515; border: 2px; border-style:solid; } table.mon_list { background-color: #ffb515; border: 2px; border-style:solid; } td.info { font-size: 15px; font-style: normal; font-weight: 100; } th.list, td.list { background-color: #ffb515; font-size: 19pt; font-style: normal; font-weight: 100; border: 2px; border-style:solid; } --> </style> <meta name="generator" content="untis 2013"> <meta name="company" content="gruber & petters software, a-2000 stockerau, austria, www.grupet.at"> </head> <body bgcolor="#fee9b1"> <center> <table align="bottom" cellspacing="3" cellpadding="2"> <tr> <td align="bottom"> <font face="verdana" size="6" color="#911083">roosterwijzigingen</font> <br><font size="4" color="#000000" face="arial">vestiging rijnwoude</font> </td> <td> </td> <td> <table width="100%" cellspacing="2" cellpadding="2"> <tr> <td></td> <td> </td> <td></td> <td> </td> <td></td> </tr> <tr> <td></td> <td> </td> <td></td> <td> </td> <td><font size="-2">gewijzigd 16-5-2013 13:54</size></td> </tr> </table> </td> </tr> </table> <p> <font size="4" face="arial"> <div class="mon_title">18-05-2013 maandag</div> <table class="mon_list" > <tr class='list'> <th class="list" align="center">klas</th> <th class="list" align="center">uur</th> <th class="list" align="center">was</th> <th class="list" align="center">wordt</th> <th class="list" align="center">was</th> <th class="list" align="center">wordt</th> <th class="list" align="center">vaklokaal</th> <th class="list" align="center">opmerking</th> </tr> <tr class='list odd'> <td class="list" align="center" style="background-color: #6f95d5">4h</td> <td class="list" align="center" style="background-color: #6f95d5">5-6</td> <td class="list" align="center" style="background-color: #6f95d5">nat1</td> <td class="list" align="center" style="background-color: #6f95d5">---</td> <td class="list" align="center" style="background-color: #6f95d5">men</td> <td class="list" align="center" style="background-color: #6f95d5">---</td> <td class="list" align="center" style="background-color: #6f95d5">---</td> <td class="list" align="center" style="background-color: #6f95d5">aulauur</td> </tr> <tr class='list even'> <td class="list" align="center">4v</td> <td class="list" align="center">1</td> <td class="list" align="center">econ3</td> <td class="list" align="center">econ3</td> <td class="list" align="center">svn</td></td> <td class="list" align="center">svn</td> <td class="list" align="center">310</td> <td class="list" align="center">lokaal wissel</td> </tr> <tr class='list odd'> <td class="list" align="center">6v</td> <td class="list" align="center">5</td> <td class="list" align="center">fatl1</td> <td class="list" align="center">fatl1</td> <td class="list" align="center">mps</td> <td class="list" align="center">mps</td> <td class="list" align="center">d03</td> <td class="list" align="center">lokaal wissel</td> </tr> <tr class='list even'> <td class="list" align="center" style="background-color: #6f95d5">6v</td> <td class="list" align="center" style="background-color: #6f95d5">8</td> <td class="list" align="center" style="background-color: #6f95d5">gs</td> <td class="list" align="center" style="background-color: #6f95d5">---</td> <td class="list" align="center" style="background-color: #6f95d5">nba</td> <td class="list" align="center" style="background-color: #6f95d5">---</td> <td class="list" align="center" style="background-color: #6f95d5">---</td> <td class="list" align="center" style="background-color: #6f95d5">aulauur</td> </tr> <tr class='list odd'> <td class="list" align="center">6v</td> <td class="list" align="center">7</td> <td class="list" align="center">nat7</td> <td class="list" align="center">nat7</td> <td class="list" align="center">men</td> <td class="list" align="center">jho</td> <td class="list" align="center">001</td> <td class="list" align="center">het 6e of 8e uur</td> </tr> </table> <p> <font size="3" face="arial"> groene hart rijnwoude </font></font> </center> <p><center><font face="arial" size="2"><a href="http://www.grupet.at" target="_blank" >untis roostersoftware</a></font></center> </body> </html>
use xml parsers on well-formed html documents. parsing html document such 1 have posted (which not seem well-formed), use of jsoup recommended. read cookbook introduction , should go in few minutes.
Comments
Post a Comment