To be blunt, I want to download the contents of https://www.myfxbook.com/statements/2531687/statement.csv
Thing is, when I try to download it into R (base package), the function returns an statement requesting login:
> url = "https://www.myfxbook.com/statements/2531687/statement.csv"
> download.file(url, destfile = "temp")
trying URL 'https://www.myfxbook.com/statements/2531687/statement.csv'
Content type 'text/csv' length unknown
downloaded 48 bytes
> readLines("temp")
[1] "Please login to Myfxbook.com to use this feature"
I tried GET from httr and got the same result:
> GET(url, authenticate(user, pass), content_type("text/csv"), write_disk("temp"))
> readLines("temp")
[1] "Please login to Myfxbook.com to use this feature"
This also failed:
> library(RCurl)
> baseurl = "https://www.myfxbook.com/statements/2531687/statement.csv"
> un = ***** # masked
> pw = ***** # masked
> upw = paste(un, pw, sep = ":")
> webpage = getURL(baseurl, userpwd = upw)
> webpage
[1] "Please login to Myfxbook.com to use this feature"
I have login info, I just don't know how to use it to download the file.
How can I get it done?
Thanks!