From: Vitor Peres Date: 2007-12-19T18:53:35+09:00 Subject: Re: Hpricot syntax different from Xpath ? ------=_Part_13720_11376859.1198058019613 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Dec 18, 2007 8:34 PM, Celine wrote: > Hi Chris, thanks for your answer > Here is the page I'm working with : http://finance.yahoo.com > I want to retrieve value of Nasdaq (up left of the page). > I sent the same message on Hpricot ML this afternoon, actually no > answer. > > Hi, Celine. I know it's not nearly as fun as screen-scraping, but you can get the value for Nasdaq (and many other quotes) on Yahoo! Finance by querying the right URL for the CSV. The current value can be obtained by fetching: http://download.finance.yahoo.com/d/quotes.csv?s=[name]&f=sl1d1t1c1ohgv&e=.csv You just have replace [name] with %5EIXIC for Nasdaq. Historical data is available (closings only) at: http://ichart.finance.yahoo.com/table.csv?&s=[name]&a=[start month]&b=[start_day]&c=[start _year]&d=[end_month]&e=[end_day]&f=[end_year]&g=d&ignore=.csv Just replace [name] with the index or stock you wish to query and each bracketed date info with integers. I've replied to a topic before that involved Yahoo! Finance, but it was specifically about searching for a symbol. Since it's not your case, here's hoping that directly fetching it will suffice. -- Vitor Peres (dodecaphonic) ------------------------------------ http://twitter.com/dodecaphonic ------=_Part_13720_11376859.1198058019613--