sewardlee337/finreportr

Could not resolve host

Opened this issue · 3 comments

l3all commented

Once in many try it does go through the request and get's me the data. The rest of the time I get the error
AnnualReports("AAPL") on any ticker I get this in the console:

Error in open.connection(x, "rb") : Could not resolve host: www.sec.gov

The problem is not just present with the function AnnualReports(), but also with all the others

I read there that it could be because sec.gov try to se if i'm a bot. (https://stackoverflow.com/questions/33295686/rvest-error-in-open-connectionx-rb-timeout-was-reached)

sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2 finreportr_1.0.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.12 dplyr_0.7.3 assertthat_0.2.0 XBRL_0.99.18 R6_2.2.2 magrittr_1.5
[7] httr_1.3.1 stringi_1.1.5 rlang_0.1.2.9000 curl_2.8.1 xml2_1.1.1 tools_3.4.1
[13] stringr_1.2.0 selectr_0.3-1 glue_1.1.1 compiler_3.4.1 pkgconfig_2.0.1 rvest_0.3.2
[19] bindr_0.1 tibble_1.3.4

Hi @l3all,

Did you solve this issue?

Best,

I've used finreportr before, but now GetIncome, GetBalanceSheet and GetCashFlow seem to have a bad URL. For example:
GetIncome("GOOG", 2018)
Error in open.connection(x, "rb") : HTTP error 403.
In addition: Warning messages:
1: In .Internal(get0(x, envir, mode, inherits, ifnotfound)) :
closing unused connection 4 (http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=WY&type=10-k&dateb=&owner=exclude&count=100)
2: In .Internal(get0(x, envir, mode, inherits, ifnotfound)) :
closing unused connection 3 (https://www.sec.gov/Archives/edgar/data/789019/000156459019027952/0001564590-19-027952-index.htm)

GetIncome("GOOG", 2019)
Error in open.connection(x, "rb") : HTTP error 403.

Hi @eweiss99

Did you manage to solve this issue?

Regards