]> git.donarmstrong.com Git - imprinted_genes.git/commitdiff
fix the look_down to only look at th and td elements
authorDon Armstrong <don@donarmstrong.com>
Fri, 8 May 2015 16:53:08 +0000 (09:53 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 8 May 2015 16:53:08 +0000 (09:53 -0700)
parse_geneimprint.pl

index 4f36a9a3a32dadab7336dc452f4db221e17bd8a5..7de04b00250edfbd3c89966a98271c6084bcdc4b 100755 (executable)
@@ -80,7 +80,7 @@ my $t = HTML::Tree->new_from_file($ARGV[0]) or
 # the table we want is currently the first table
 my $table = $t->look_down(_tag=>'table');
 for my $row ($table->look_down(_tag=>'tr')) {
-    print join("\t",map{my $a = $_->as_text(); $a =~ s/\xA0/ /g; $a;} $row->descendents())."\n";
+    print join("\t",map{my $a = $_->as_text(); $a =~ s/[\xA0\t]/ /g; $a;} $row->look_down(_tag => qr/^(?:th|td)$/))."\n";
 }