 
I have seen the same error message as you write about.  My experience is that it is due to Yahoo's rate limiting how often one can request a historical stock price.  (This is true for other parts of Yahoo!, unrelated to finance, that I have scraped in the past as well) I usually get this message after 150 stocks or so with minimal delay's in-between.  As I increase the delay to 30 seconds between requests (after going quiescent) this error message goes away.  


I know the HTTP Status message is 404, but this is simply Yahoo's way of telling you to "slow down/go away"; it's not like Yahoo! is running an out-of-the-box lighttpd/nginx/apache server serving up standard error messages when people abuse their services.

Stergios Marinopoulos


Date: Wed, 4 Apr 2012 01:52:43 -0400
 From: benn fine <bennfine@gmail.com>
To: r-sig-finance@r-project.org
Subject: [R-SIG-Finance] error catching in getSymbols
Message-ID:
    <CALghxgR+COeFLdSuQURMzdeQN9gOkw7HRjrBgxVN0GoofSmG4g@mail.gmail.com>
Content-Type: text/plain

I've googled and found a similar question at
http://stackoverflow.com/questions/8502512/quantmod-overriding-the-warning-messagebut
no answer.........

When I loop over several stocks using getSymbols, yahoo will occasionally
barf as if I have asked it for too many quotes.
Is there a workaround for this? Using Sys.sleep doesn't seem to help:

sdvals=1:100
for(i in 1:100)  {
Sys.sleep(2)
cat("Getting Data for Stock ",nas100[i,1],"\n")
foo=getSymbols(nas100[i,2],auto.assign=FALSE)
rfoo=monthlyReturn(foo)
sdvals[i]=sqrt(var(rfoo))
}

Getting Data for Stock  Activision
Getting Data for Stock  Adobe
Getting Data for Stock  Akamai
Getting Data for Stock  Alexion
Getting Data for Stock  Altera
Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,
:
  cannot open URL '

4&f=2012&g=d&q=q&y=0&z=ALTR&x=.csv
'
In addition: Warning message:
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  :
  cannot open: HTTP status was '404 Not Found'

Thanks!

    [[alternative HTML version deleted]]



 
--
Stergios Marinopoulos
	[[alternative HTML version deleted]]

