htmlの要素をいろいろ扱うのに便利にゃ物体。
use WWW::Mechanize;
use Web::Scraper;
my $host = 'nekoneko.com';
my $user = 'admin';
my $pass = 'password';
my $url = "http://$host/info";
my $mech = WWW::Mechanize->new();
$mech->get( $url );
$mech->set_visible( $user, $pass ) ;
$mech->click( "login" , 0 , 0 );
my $html = $mech->content;
my $scraper = scraper {
process '//table/tr/td' , 'desc[]' => 'TEXT';
};
my $res = $scraper->scrape($mech->content, $mech->uri);
これで$res->{desc}にtableのtdがリストで入る。cssとかxpathとかごりごりすればもっと何でも出来る気味。
xpathはコマンドラインでscraperを起動するとtry&err出来るので囓りにゃがら何とかにゃるんじゃにゃいかにゃ、と。
新しいカーネルだとinst失敗するので、ubuntuの1つ前のserver 8.x。カーネルが古いのをチョイス。
apt-get install libncurses5-dev zlib1g-dev psmisc libx11-dev xspecs
libxtst6 xinetd screen ssh linux-headers-lbm-2.6.24-23-server
./vmware-install.pl
The current administrative user for VMware Server is ''. Would you like to
specify a different administrator? [no] yes
でhttps://IP:8333を叩けばにゃんか出る。
が、
chmod 775 /etc/vmware
chmod 664 /etc/vmware/ssl/*
で、vmware server2だが、つ、使いにくい。これは酷い。