2
我需要从网站上的表格中刮取一些网站数据并创建将由应用程序使用的XML文档。刮掉HTML表格数据并创建XML文档
表看起来是这样的:
<table id="results" class="results">
<thead>
<tr>
<th scope="col" class="resRoute">Route</th>
<th scope="col" class="resDir">To</th>
<th scope="col" class="resDue sorted">Time</th>
</tr>
</thead>
<tbody>
<tr>
<td class="resRoute">263</td>
<td class="resDir">Route Name</td>
<td class="resDue">1 min</td>
</tr>
<tr>
<td class="resRoute">17</td>
<td class="resDir">Route Name</td>
<td class="resDue">2 min</td>
</tr>
</tbody>
</table>
而且我想创建一个XML饲料,看起来像这样:
<train>
<route>263</route>
<direction>Route Name</direction>
<due>2 Min</due>
</train>
<train>
<route>17</route>
<direction>Route Name</direction>
<due>12 Min</due>
</train>