[R] quantmod Some Single Letter Tickers Not getFin

From: Sparks, John James <jspark4_at_uic.edu>
Date: Thu, 17 Mar 2011 22:48:13 -0500


I have been learning the quantmod package over the last several days. I went to check some of my data pulls against other sources and was surprised to find that a few tickers that have single characters do not successfully scrape from Google Finance using getFin(). Particularly



all result in a file not found error. I show the last one below.

> getFin("M")

Error in download.file(paste(google.fin, Symbol, sep = ""), quiet = TRUE, :   cannot open URL '
http://finance.google.com/finance?fstype=ii&q=M' In addition: Warning message:
In download.file(paste(google.fin, Symbol, sep = ""), quiet = TRUE, :   cannot open: HTTP status was '400 Bad Request'

I checked out the financial statement pages for all of these and they exist and are as expected: 5 quarters worth of quarterly figures (except for cash-flow which has 4 quarters) and 4 years of annual figures. All the rows are also present by comparing a scrape to excel with the figures for "Y", which does getFin("Y") without a problem.

I was hoping that someone who knows a lot more about scraping then I do could look into this.

Best wishes to all,
--John Sparks

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 18 Mar 2011 - 03:52:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 19 Mar 2011 - 16:50:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive