[Simple R crawling for stock]


Here is a simple starting example to get present value of some stocks, such as MSFT(Microsoft)+ MU(Micron) + ....

I wonder if someone did this or have some reference/books.

Let our input file have MSFT, MU, ... in vector with length of 100 (or possibly 1000), and hope to get the present value of the 100 stocks from webpage below and to store EVERY MINUTES (or every 5 minutes) in local PC.

This is called Crawling(or Scrapping) of R.

Let us use google webpage of MSFT, as in https://www.google.com/search?biw=1...XL43pOmf0#scso=uid_2YUbW-TSCovW8QW5na6YDA_5:0

OR you may use the yahoo page as in https://finance.yahoo.com/quote/MSFT?p=MSFT


Probably packages rvest does this work for us.

Appreciated if someone help me to make R codes with a few lines.

I have experience to use quantmod package.

quantmod is useful to get such as MSFT daily OHLC for the past 3 years.

However, I am looking for MSFT current (moving) price EVERY MINUTES during 9:30 and 4 EST.

Many portal website (google and yahoo) show current price in their webpage during the day, I am looking for web scraping in their webpage.
An API-Interface is much more reliable than webscraping.

You will find much more API Interfaces to financial databases in Python, especially when you are using financial algorithm backtesting portals like Quantopian.com. And the best thing is: You can still use R in Python by the RPY2 library.