如何从 XML/HTML 页面获取数据?
我想制作一个 android 应用程序,用户可以在其中收到关于学校课程失败的通知。这是网站的样子: http ://www.anony.ws/image/pC9
用户在安装应用程序后填写他们的学校班级(klas)。我想从表中选择数据,如果是他们的班级,用户应该收到通知。(例子:
if ( userClass == klas ), then alert ("hey, " + was + " will be " + was + "because of" + opmerking);
类似的东西。但我不知道我应该如何从表格中挑选数据,这是一个奇怪的页面。使它变得更加困难,因为页面从 (1/2) 淡化到 (2/2) (每页最多 10 个列表,所以 50 个列表 = 5 页),在此处查找示例:http: //suse.ghlyceum.nl /dagrooster/lwoo/。我应该如何选择数据并将它们放入 java vars 中!
我需要挑选的代码示例
<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>
完整的网站代码:
<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>