--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java 2010/09/14 05:20:17 1045 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java 2010/09/14 05:33:30 1046 @@ -244,11 +244,26 @@ String tableName = arrival == false ? "afgangtabel" : "ankomsttabel"; Element table = page.getElementById(tableName); + + if (table != null) { Elements tableRows = table.getElementsByTag("tr"); + boolean passedTidsstreg = false; + boolean tidsstregExists = (table.getElementsByAttributeValue("class", "Tidsstreg").size() > 0); + for (Element currentRow : tableRows) { String rowClass = currentRow.attr("class"); + + if (tidsstregExists == true && passedTidsstreg == false) { + if (currentRow.getElementsByAttributeValue("class", "Tidsstreg").size() > 0) { + passedTidsstreg = true; + } else { + continue; + } + } + + if (rowClass != null && rowClass.toLowerCase().contains("station") ) { Elements fields = currentRow.getElementsByTag("td");