使用 download.file() 在 R 中下载后无法打开 pdf

问题描述

我正在尝试使用 download.file() 下载 pdf 文件。 但是,当我将文件放入文件夹并尝试打开它时,我收到以下消息“无法打开文档”。

url <- 'https://www.tre-mg.jus.br/eleitor/titulo-e-local-de-votacao/tre-mg-locais-votacao/tre-mg-numero-eleitores-local-votacao/rybena_pdf?file=https://www.tre-mg.jus.br/eleitor/titulo-e-local-de-votacao/tre-mg-locais-votacao/tre-mg-numero-eleitores-local-votacao/at_download/file'


download.file(url,'200227_locais_votacao_nr_eleitores.pdf')

我使用的版本是:

version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64,linux-gnu           
status                                     
major          4                           
minor          0.2                         
year           2020                        
month          06                          
day            22                          
svn rev        78730                       
language       R                           
version.string R version 4.0.2 (2020-06-22)
nickname       Taking Off Again  

我是否遗漏了什么,或者我应该从另一个角度解决这个问题吗?非常感谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)