Last active
February 20, 2021 21:11
-
-
Save jadiunr/c5bb8f321600a9d7a51e4de7323f25f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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