Skip to content

Instantly share code, notes, and snippets.

@sironekotoro
Created December 18, 2019 05:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sironekotoro/9d9a3b4aed208d81d51233f4c9cf59cc to your computer and use it in GitHub Desktop.
Save sironekotoro/9d9a3b4aed208d81d51233f4c9cf59cc to your computer and use it in GitHub Desktop.
日経225構成銘柄の証券コードを取得する
use strict;
use warnings;
use HTTP::Tiny;
my $URL = 'https://indexes.nikkei.co.jp/nkave/index/component?idx=nk225';
my $response = HTTP::Tiny->new->get($URL);
die "Failed!\n" unless $response->{success};
my @stock_code = $response->{content} =~ /scode=(\d{4})\"/g;
print "@stock_code";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment