Created
November 18, 2015 18:21
-
-
Save Skarsnik/9d66920ad3f04362388e to your computer and use it in GitHub Desktop.
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
use Gumbo::Parser; # replace with HTML::Parser::XML | |
use XML; | |
my $parser = Gumbo::Parser.new; | |
my $html = qqx{wget -o /dev/null -O - https://www.fimfiction.net/bookshelf/149291/}; | |
say "Getting/parsing a wegpage with a quite huge xml tree, prepare yourself some coffee if you use H:P:X"; | |
say "webpage is "~$html.chars~" size."; | |
my $xml = $parser.parse($html); | |
say "Parsing done : looking for something, forever"; | |
for 1..1000 { | |
my @characters = $xml.lookfor(:TAG<a>, :class<character_icon>); #shortcut for elements method | |
sleep 0.5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment