changeset 165:1d17dbb864ff

Fix parsing of new format of UNTIS html output.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 23 Aug 2015 19:39:42 +0300
parents 2654466d2655
children 0c3c27de6710
files parsedata.pl
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/parsedata.pl	Sun Aug 23 19:16:17 2015 +0300
+++ b/parsedata.pl	Sun Aug 23 19:39:42 2015 +0300
@@ -430,7 +430,7 @@
 # Filter out some more, for easier tree access during table parsing
 $data =~ s/<\/?b>//ig;
 my $tree = parse_html($data);
-my $node = fnode(fnode($tree, "body"), "table");
+my $node = fnodea(fnode($tree, "body"), "table", "border=\"3\" rules=\"all\" cellpadding=\"1\" cellspacing=\"1\"");
 die("No table element found in document. Perhaps the format has changed? :(\n") unless defined($node);
 
 
@@ -448,7 +448,7 @@
       my $l = $$n{"nodes"}[0]{"nodes"};
       if (defined($l))
       {
-        if ($$n{"args"} =~ /colspan=6\s+rowspan=(\d+)/)
+        if ($$n{"args"} =~ /colspan=12\s+rowspan=(\d+)/)
         {
           parse_hour_data($l, $1);
         }