Created
January 27, 2016 05:23
-
-
Save phil21/51f94fa38ba8b30156e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Mojo::Base -strict; | |
use Mojo::UserAgent; | |
use Data::Dumper; | |
my $ua = Mojo::UserAgent->new(max_redirects => 10); | |
my $url = 'http://www.supermicro.com/products/motherboard/Xeon/C600/X10SRi-F.cfm'; | |
my $dom = $ua->get($url)->res->dom; | |
my @foo = $dom->find('td.description') | |
->grep(sub{ $_->parent->at('td')->all_text eq 'IPMI' }) | |
->[0] # take the first match, assume there's only one | |
->find('li') | |
->map('text') | |
->to_array; | |
print Dumper \@foo; | |
for my $line (@foo) { | |
chomp($line); | |
print "$line\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment