Changes

Jump to navigation Jump to search
859 bytes added ,  14:41, 14 March 2016
no edit summary
The Perl Libraries I used to create this webcrawler are
use strict;
use [http://search.cpan.org/~ether/libwww-perl-6.15/lib/LWP/Simple.pm LWP::Simple];
use [http://search.cpan.org/~cjm/HTML-Tree-5.03/lib/HTML/Tree.pm HTML::Tree];
Using the LWP::Simple library makes it easy to rip the HTML off the website by simply doing,
$content = get(your url as a string here);
The URL used to access the General Fanager page containing data from all the players is [http://www.generalfanager.com/players http://www.generalfanager.com/players]. Now the HTML::Tree libraryallows us to parse the HTML code into a more accessible tree structure. $tree = HTML::Tree->new(); $tree->parse($content);Now, with the HTML code parsed we can look down the tree to find what we are searching for. $tree->look_down( '_tag', 'tag of what you are looking for here')Will return an array with each element of the array containing the HTMl tree down from where the tag was found. I used the tag table because it was the most specific tag above the player stat, and put the resuls into the @tables variable.Now in order to access the data of each individual player you must look inside the @tables variable
Anonymous user

Navigation menu