244 |
String tableName = arrival == false ? "afgangtabel" : "ankomsttabel"; |
String tableName = arrival == false ? "afgangtabel" : "ankomsttabel"; |
245 |
Element table = page.getElementById(tableName); |
Element table = page.getElementById(tableName); |
246 |
|
|
247 |
|
|
248 |
|
|
249 |
if (table != null) { |
if (table != null) { |
250 |
Elements tableRows = table.getElementsByTag("tr"); |
Elements tableRows = table.getElementsByTag("tr"); |
251 |
|
|
252 |
|
boolean passedTidsstreg = false; |
253 |
|
boolean tidsstregExists = (table.getElementsByAttributeValue("class", "Tidsstreg").size() > 0); |
254 |
|
|
255 |
for (Element currentRow : tableRows) { |
for (Element currentRow : tableRows) { |
256 |
String rowClass = currentRow.attr("class"); |
String rowClass = currentRow.attr("class"); |
257 |
|
|
258 |
|
if (tidsstregExists == true && passedTidsstreg == false) { |
259 |
|
if (currentRow.getElementsByAttributeValue("class", "Tidsstreg").size() > 0) { |
260 |
|
passedTidsstreg = true; |
261 |
|
} else { |
262 |
|
continue; |
263 |
|
} |
264 |
|
} |
265 |
|
|
266 |
|
|
267 |
if (rowClass != null && rowClass.toLowerCase().contains("station") ) { |
if (rowClass != null && rowClass.toLowerCase().contains("station") ) { |
268 |
Elements fields = currentRow.getElementsByTag("td"); |
Elements fields = currentRow.getElementsByTag("td"); |
269 |
|
|