When I try download XML file from this site using R and open after, the document don't open. But if I go to this link using chrome and download manually, the file work normaly
url <- "http://fnet.bmfbovespa.com.br/fnet/publico/downloadDocumento?id=71259"
nome <- paste("C:/Users/Vinicius_KDF/Desktop/Apresentar para a liga - introducao ao R/informes b3/14788492000136-IFP12122019V01-000071259.xml")
download_xml(url, file = nome, quiet = FALSE, mode = "wb",
handle = curl::new_handle())
When I download with R and open with notepad++, return this:
"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pg0KPERhZG9zRWNvbm9taWNvRmluYW5jZWlyb3MgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSI+DQoJPERhZG9zR2VyYWlzPg0KCQk8Tm9tZUZ1bmRvPkZJSSBQQVRFTyBCQU5ERUlSQU5URVM8L05vbWVGdW5kbz4NCgkJPENOUEpGdW5kbz4xNDc4ODQ5MjAwMDEzNjwvQ05QSkZ1bmRvPg0KCQk8RGF0YUZ1bmNpb25hbWVudG8+MjAxMy0wMS0yMTwvRGF0YUZ1bmNpb25hbWVudG8+DQoJCTxQdWJsaWNvQWx2bz5JbnZlc3RpZG9yZXMgZW0gR2VyYWw8L1B1YmxpY29BbHZvPg0KCQk8Q29kaWdvSVNJTj5CUlBBVEJDVEYwMDQ8L0NvZGlnb0lTSU4+DQoJCTxRdGRDb3Rhc0VtaXRpZGFzPjM0Nzg2NDM8L1F0ZENvdGFzRW1pdGlkYXM+DQoJCTxGdW5kb0V4Y2x1c2l2bz5mYWxzZTwvRnVuZG9FeGNsdXNpdm8+DQoJCTxWaW5jdWxvRmFtaWxpYXJDb3Rpc3Rhcz5mYWxzZTwvVmluY3Vsb0ZhbWlsaWFyQ290aXN0YXM+DQoJCTxBdXRvcnJlZ3VsYWNhbz4NCgkJCTxNYW5kYXRvPlJlbmRhPC9NYW5kYXRvPg0KCQkJPFNlZ21lbnRvQXR1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