通过R从URL下载数据

时间:2019-01-08 15:03:31

标签: r url download

通过点击global wind atlas中的地图,可以点击GWC file选项来下载数据。 它将打开另一个网址,例如: https://globalwindatlas.info/api/gwa/custom/Lib/?lat=52.802761&long=21.269531 然后用户可以保存数据。仅使用该链接,如何从R进行下载?我已经尝试过类似的东西:

download.file("https://globalwindatlas.info/api/gwa/custom/Lib/?lat=52.802761&long=21.269531",destfile = "test.txt")

但是它返回错误:

trying URL 'https://globalwindatlas.info/api/gwa/custom/Lib/?lat=52.802761&long=21.269531'
Error in download.file("https://globalwindatlas.info/api/gwa/custom/Lib/?lat=52.802761&long=21.269531",  : 
  cannot open URL 'https://globalwindatlas.info/api/gwa/custom/Lib/?lat=52.802761&long=21.269531'
In addition: Warning message:
In download.file("https://globalwindatlas.info/api/gwa/custom/Lib/?lat=52.802761&long=21.269531",  :
  cannot open URL 'https://globalwindatlas.info/api/gwa/custom/Lib/?lat=52.802761&long=21.269531': HTTP status was '403 Forbidden'

0 个答案:

没有答案
相关问题