Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Program to extract relevant details from HTML files.

  • Loading branch information...
commit d2c3909f31089a4331294f5f53f111c0c5f2b857 1 parent 6e44524
@davorg authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 buildtext
View
24 buildtext
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use 5.010;
+
+use Web::Scraper;
+use Data::Dumper;
+
+my $scraper = scraper {
+ process 'table.tracks tr', 'tracks[]' => scraper {
+ process '//td[1]', track => 'TEXT',
+ process '//td[2]', artist => 'TEXT',
+ process '//td[3]', title => 'TEXT',
+ },
+};
+
+my $html = do { local $/; <> };
+
+my $res = $scraper->scrape($html);
+
+foreach (@{$res->{tracks}}) {
+ say "$_->{track}\t$_->{title}\t$_->{artist}";
+}
Please sign in to comment.
Something went wrong with that request. Please try again.