After years of posting daily stock prices on its website in practically useless pdf files; the Wall Street Journal has set up a page where one can download daily stock price data as CSV files. This script simply goes to the relevant page at WSJ.com, downloads the files, and names each file with the market acronym and the day's date concatenated. Updated: to reflect change in WSJ site.
use strict; use LWP::Simple; while (my $downloadurl = <DATA>){ my $x="http://online.wsj.com/public/resources/documents/"; my $finurl=$x.$downloadurl; my @urlsplit=split /\./, $downloadurl; my $now_string = substr(localtime,0,11); my $savefilename = $urlsplit[0].$now_string; print $savefilename; print "\n"; my $status = getstore($finurl,$savefilename); print $status."\n" if is_success($status); } __END__; NYSE.csv Nasdaq.csv SCAP.csv AMEX.csv