Created
October 28, 2012 20:15
-
-
Save jberger/3969742 to your computer and use it in GitHub Desktop.
text_after a certain h4
This file contains 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/env perl | |
use strict; | |
use warnings; | |
use v5.10; | |
use Mojo::DOM; | |
my $dom = Mojo::DOM->new( <<'HTML' ); | |
<div class="txt-block"> | |
<h4 class="inline">Opening Weekend:</h4> | |
€2,137,456 | |
(Italy) | |
(15 April 2012) | |
(420 Screens) | |
</div> | |
<div class="txt-block"> | |
<h4 class="inline">Second Weekend:</h4> | |
€1,000,000 | |
(Italy) | |
(22 April 2012) | |
(420 Screens) | |
</div> | |
HTML | |
say for $dom->find('div.txt-block h4.inline') | |
->grep(sub{$_->text eq 'Opening Weekend:'}) | |
->pluck('text_after') | |
->each; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment