128 |
if (table != null) { |
if (table != null) { |
129 |
Elements tableRows = table.getElementsByTag("tr"); |
Elements tableRows = table.getElementsByTag("tr"); |
130 |
|
|
131 |
|
boolean tidsstregExists = (table.getElementsByAttributeValue("class", "Tidsstreg").size() > 0); |
132 |
|
boolean passedTidsstreg = false; |
133 |
|
|
134 |
for (Element currentRow : tableRows) { |
for (Element currentRow : tableRows) { |
135 |
String rowClass = currentRow.attr("class"); |
String rowClass = currentRow.attr("class"); |
136 |
|
|
137 |
|
if (tidsstregExists == true && passedTidsstreg == false) { |
138 |
|
if (currentRow.getElementsByAttributeValue("class", "Tidsstreg").size() > 0) { |
139 |
|
passedTidsstreg = true; |
140 |
|
} else { |
141 |
|
continue; |
142 |
|
} |
143 |
|
} |
144 |
|
|
145 |
if (rowClass != null && rowClass.toLowerCase().contains("station") ) { |
if (rowClass != null && rowClass.toLowerCase().contains("station") ) { |
146 |
|
|
147 |
Elements fields = currentRow.getElementsByTag("td"); |
Elements fields = currentRow.getElementsByTag("td"); |
148 |
|
|
149 |
DepartureEntry departure = new DepartureEntry(); |
DepartureEntry departure = new DepartureEntry(); |