Check out this site:
http://www.gummy-stuff.org/Yahoo-data.htm

It shows how to download a .csv file with the data you might want.

Here is an example URL:
 http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yrr2


The "r2" in the above URL means P/E ratio.

You should be able to automate this in R pretty easily. An endeavor I leave to the reader.

Good luck,
KW


	[[alternative HTML version deleted]]

