New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.StringIndexOutOfBoundsException: String index out of range: -1 #44
Comments
Hi, This is really strange. The fact that the CSV line starts with
Could you open the link in your browser to see what you get? http://finance.yahoo.com/d/quotes.csv?s=INTC&f=nsc4xab2sa5sbb3sb6sl1sk3sd1t1opghva2kjm3m4sj2sss1sj1sf6sr1qdyee7e9e8rr5p6p5b4s6j4t8s7&e=.csv |
Hi, I'm able to open the link in a browser and able to get CSV downloaded. When I try it in a eclipse program, it is giving error though the same program worked a day back. I checked my proxy and its all good nothing changed recently in my system too |
Sorry, no idea what the problem is. This should work. Could you give it a try without the proxy? |
I finally figured the issue, the code works but when we issue more than 1000 requests per hours then we are hitting this issue "Yahoo says you have reached the limit". Thanks for your help though |
I'm having the same issue. Can you provide how you fixed this? |
Apparently, the Yahoo Finance API is now closed and every time we hit it throws "String Index out of Bounds exception" |
Please just use the latest version of the library... (3.12.3) |
Source:
package asd.cc;
import java.io.IOException;
import java.math.BigDecimal;
import yahoofinance.Stock;
import yahoofinance.YahooFinance;
public class Sstocks {
}
Error 👍
Apr 10, 2016 11:02:38 AM yahoofinance.quotes.QuotesRequest getResult
INFO: Sending request: http://finance.yahoo.com/d/quotes.csv?s=INTC&f=nsc4xab2sa5sbb3sb6sl1sk3sd1t1opghva2kjm3m4sj2sss1sj1sf6sr1qdyee7e9e8rr5p6p5b4s6j4t8s7&e=.csv
Apr 10, 2016 11:02:38 AM yahoofinance.quotes.QuotesRequest getResult
INFO: Parsing CSV line:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at yahoofinance.quotes.stock.StockQuotesRequest.parseCSVLine(StockQuotesRequest.java:126)
at yahoofinance.quotes.stock.StockQuotesRequest.parseCSVLine(StockQuotesRequest.java:11)
at yahoofinance.quotes.QuotesRequest.getResult(QuotesRequest.java:95)
at yahoofinance.YahooFinance.getQuotes(YahooFinance.java:355)
at yahoofinance.YahooFinance.get(YahooFinance.java:85)
at yahoofinance.YahooFinance.get(YahooFinance.java:69)
at asd.cc.Sstocks.main(Sstocks.java:15)
The text was updated successfully, but these errors were encountered: