Skip to content

Instantly share code, notes, and snippets.

@jadiunr
Last active February 20, 2021 21:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jadiunr/c5bb8f321600a9d7a51e4de7323f25f3 to your computer and use it in GitHub Desktop.
Save jadiunr/c5bb8f321600a9d7a51e4de7323f25f3 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use utf8;
use feature 'say';
use Furl;
use Mojo::DOM;
my ($http, $url, $results) = (Furl->new, 'https://shindanmaker.com/832038', []);
for my $count (1..1e6) {
my $content = $http->post($url, [], {u => $count})->content;
my $word = Mojo::DOM->new($content)->at('.result2 > div')->text;
$word =~ s/\n|\t| //g;
say $word;
push @$results, $word unless grep {$_ eq $word} @$results;
last if @$results >= 200;
}
open my $fh, '>', 'result.txt';
say $fh $_ for @$results;
close $fh;
=encoding utf8
=head1 NAME
天一であっさりを頼む奴にありがちな200の特徴を取得するプログラム
=head1 USAGE
perl tennichi_scraping.pl
=cut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment