#!/usr/bin/perl use strict; use warnings; use utf8; use Term::ANSIColor qw(:constants); my $scrappy = `curl -s 'https://wiki.oceannetworks.ca/display/O2A/Available+Deployments' 2>&1`; my $lineX; my $count = 0; foreach $lineX ( split /\n/, $scrappy ) { if ( $lineX =~ /^\s*$/ ) { # Skip white spaces or comment line next; } my @F = split( " ", $lineX ); my $mylen = length $lineX; if ( $mylen ge 2 ) { if ( ( $F[0] eq '' ) and ( $F[-1] ne '

' ) ) { my @f = split />/, $F[1]; $count++; if ( $count == 1 ) { print "locationCode: $f[1]\n"; } elsif ( $count == 2 ) { print "deviceCode: $f[1]\n"; } elsif ( $count == 3 ) { print "dateFrom: $f[1]\n"; } elsif ( $count == 4 ) { print "dateTo: $f[1]\n"; } } } }