--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java 2010/07/14 19:22:23 994 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java 2010/08/30 13:59:54 1021 @@ -63,6 +63,8 @@ StationBean station = stationDao.getById(stationID); + departureBean.stationName = station.getName(); + if (station.getRegional() != null) { DepartureBean tempBean = lookupDepartures(station.getRegional(), TrainType.REGIONAL, arrival); departureBean.departureEntries.addAll( tempBean.departureEntries ); @@ -128,9 +130,22 @@ if (table != null) { Elements tableRows = table.getElementsByTag("tr"); + boolean tidsstregExists = (table.getElementsByAttributeValue("class", "Tidsstreg").size() > 0); + boolean passedTidsstreg = false; + 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"); DepartureEntry departure = new DepartureEntry();