ti.jaheed
ti.jaheed

Reputation: 21

How to scrape from investing.com using 'rusquant' package in R

I posted a similar question before [the question is closed now, I deleted it]. From that I came to know about 'rusquant' package. I thank the person who introduced me to the package 'rusquant' here. I tried the following codes in several unsuccessful attempts to scrape stock data from investing.com

library(rusquant)
all_stocks <- getSymbolList(src = "Investing", country = "Bangladesh")
head(all_stocks, 4)
from_date <- date("2021-01-01")
grameenphone <- getSymbols('GRAE', src = 'Investing', from = from_date, auto.assign = F)
grameenphone <- getSymbols.Investing('GRAE', from = from_date, auto.assign = F)

Now, the getSymbolList function works. But when I try to scrape for a particular stock, and I followed the method from https://github.com/arbuzovv/rusquant, I get an error. as follows:

 grameenphone <- getSymbols('GRAE', src = 'Investing', from = from_date, auto.assign = F)
‘getSymbols’ currently uses auto.assign=TRUE by default, but will
use auto.assign=FALSE in 0.5-0. You will still be able to use
‘loadSymbols’ to automatically load data. getOption("getSymbols.env")
and getOption("getSymbols.auto.assign") will still be checked for
alternate defaults.

This message is shown once per session and may be disabled by setting 
options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.

Error in curl::curl_fetch_memory(url, handle = handle) : 
  Unrecognized content encoding type. libcurl understands deflate, gzip content encodings.

Then I tried getSymbols.Investing function. But I get following error:

grameenphone <- getSymbols.Investing('GRAE', from = from_date, auto.assign = F)
Error in missing(verbose) : 'missing' can only be used for arguments

Please help me out here. I'm new in coding. I apologize if anything silly happened here. Thanks in advance.

Upvotes: 2

Views: 1339

Answers (0)

Related Questions