The URL,
http://builder.cnet.com/webbuilding/pages/Programming/JSP/ss05.html
has a JSp example, to get quotes from yahoo page.
private void getSymbolValue(String symbol) {
String urlString =
"http://quote.yahoo.com/download/javasoft.beans?SYMBOLS=" +
symbol + "&format=nl";
try {
URL url = new URL(urlString);
URLConnection con = url.openConnection();
InputStream is = con.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line = br.readLine();
StringTokenizer tokenizer = new StringTokenizer(line,",");
name = tokenizer.nextToken();
name = name.substring(1, name.length()-2); // remove quotes
price = tokenizer.nextToken();
price = price.substring(1, price.length()-2); // remove quotes
} catch (IOException exception) {
System.err.println("IOException: " + exception);
}
How do I figure out the URL,
"http://quote.yahoo.com/download/javasoft.beans?SYMBOLS=" +
symbol + "&format=nl";
for the exchange rates page? There is no "/download/ etc. etc." path at the finance.yahoo.com page!