Created
June 8, 2009 05:48
-
-
Save hidek/125650 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
| use strict; | |
| use warnings; | |
| use Web::Scraper; | |
| use URI; | |
| use Data::Dumper; | |
| my $s = scraper { | |
| process '//p', 'foo[]' => sub {return {foo => 'bar', hoge => 'huga'}}; | |
| result qw/foo/; | |
| }; | |
| my $res = $s->scrape(URI->new("http://localhost/~hide/hoge.html")); | |
| warn Dumper $res; | |
| --- | |
| <html> | |
| <p>a</p> | |
| <p>b</p> | |
| </html> | |
| --- | |
| $VAR1 = [ | |
| { | |
| 'foo' => 'bar', | |
| 'hoge' => 'huga' | |
| }, | |
| { | |
| 'foo' => 'bar', | |
| 'hoge' => 'huga' | |
| } | |
| ]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment