Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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