perlを始めて日の浅い初心者です。 練習として、google検索をしてその件数を出すというプログラムを書いているのですが、 出力と手動で検索した時の件数に誤差が生じます。 ソース挙げておきますので、良ければご指摘下さい。 よろしくお願いします。 use Web::Scraper; use URI; use utf8; use Encode;
my $scraper = scraper { process '/html/body/div[2]/p/b[2]', 'kensuu' => 'TEXT';}; my $uri = new URI('www.google.com/search'); $uri->query_form( hl => 'ja' , q => 'コミュニケーション'); my $res = $scraper->scrape($uri); print $res->{kensuu};