Вы можете получить HTML и разобрать, что вы хотите.Вот некоторый основной код, использующий клиент Apache:
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
public class YahooFinanceScraper {
// HTTP GET the given URL
private static String HttpGET(String url) {
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
int responseCode = 0;
String responseHTML = null;
try {
responseCode = client.executeMethod(method);
responseHTML = method.getResponseBodyAsString();
} catch (Exception e) {
// log me!
} finally {
method.releaseConnection();
}
return response;
}
String quote(String symbol) {
String data = "";
String HTML = HttpGET(YAHOO_FINANCE_QUOTE_URL + symbol);
// BIG TODO: parse the HTML for whatever data you find interesting
return data;
}
public static void main(String[] args) {
YahooFinanceScraper y = new YahooFinanceScraper();
String data = y.quote("FTSE");
}
static final String YAHOO_FINANCE_QUOTE_URL = "http://finance.yahoo.com/q?s=^";
}