Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting stock data from yahoo

TheWizEdMay 14 2017 — edited May 15 2017

I have a java program I've written that I have used for years to obtain historical stock data from yahoo. 

I build a url such as

buffer = "http://ichart.finance.yahoo.com/table.csv?s=BARAX&a=4&b=5&c=2017&d=4&e=14&f=2017&g=d&ignore=.csv";

url = new URL(buffer.toString());

in = new BufferedReader(new InputStreamReader(url.openStream()));

text = in.readLine();

System.out.println(text);

I catch any errors but nothing is wrong however text is empty where as before it contained stock data.

Does anyone have any ideas what has changed, either in java or Windows to prevent this?

Using jre1.8.0_131 and Windows 7 SP1.

If you copy and paste the url to a browser window a file will be downloaded to the hard drive containing the stock data.

This post has been answered by TheWizEd on May 15 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 12 2017
Added on May 14 2017
1 comment
553 views