Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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?
[marto]: Discipulus Let's discuss Podmaster's Signature and the response from tye
[Discipulus]: thanks marto i'll read it after an urgent phonecall
[choroba]: I configured signature font to 2pt size, so I don't care

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2017-06-23 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (539 votes). Check out past polls.