1
0
Fork 0
Browse Source

Ignore rows not containing any collectable data

master
clerie 2 years ago
parent
commit
678d00a57b
  1. 7
      js/reiseauskunft.js

7
js/reiseauskunft.js

@ -151,6 +151,10 @@ var connection_result_observer = new MutationObserver((mutations) => { @@ -151,6 +151,10 @@ var connection_result_observer = new MutationObserver((mutations) => {
var relations = timetable.querySelectorAll("tr.first");
relations.forEach((relation, i) => {
var relationend = relation.nextElementSibling;
while(relationend.querySelector("td.station") == null) {
relationend = relationend.nextElementSibling;
}
data[i] = {};
data[i]["from"] = {}
data[i]["to"] = {}
@ -240,6 +244,9 @@ var connection_result_observer = new MutationObserver((mutations) => { @@ -240,6 +244,9 @@ var connection_result_observer = new MutationObserver((mutations) => {
var relations = timetable.querySelectorAll("tr.first");
relations.forEach((relation, i) => {
var relationend = relation.nextElementSibling;
while(relationend.querySelector("td.station") == null) {
relationend = relationend.nextElementSibling;
}
var products = relation.querySelectorAll("td.products span a");
products.forEach((product, j) => {

Loading…
Cancel
Save