Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Get US stock tables from WSJ

by Scott7477 (Chaplain)
on Sep 19, 2006 at 03:31 UTC ( #573628=snippet: print w/ replies, xml ) Need Help??
Description: 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
Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://573628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2016-07-23 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (221 votes). Check out past polls.