I am trying to download a .xlsx file from an embedded "Export to Excel" link within a .aspx webpage.
https://www.ftportfolios.com/Retail/Etf/EtfHoldings.aspx?Ticker=FTSM
I have tried the following code, but it is failing to download the correct file. Any help would be greatly appreciated! Thank you
FTSM_url<- "https://www.ftportfolios.com/Retail/Etf/EtfHoldings.aspx?Ticker=FTSM"
download.file(FTSM_url, destfile = "FTSM-Holdings.xlsx", mode = "wb")