使用R,我想从此站点获取.csv:https://vacationwithoutacar.com/gvrat-tracking/,但是没有与下载相关的链接,它只会自动弹出。通常,我会使用httr
下载功能,但是当我右键单击链接时,它没有提供复制URL的选项。没有太多可重复的示例,因为好吧,我什至无法下载文件。
GET("https://vacationwithoutacar.com/gvrat-tracking/",
write_disk("gvrat.txt",
overwrite = TRUE)
)
这似乎有效...
我在chrome中打开了网址,点击了F12,点击了网络,可以清除垃圾箱,重新加载页面。然后寻找一些下载数据的请求。我看到下面的URL返回了JSON。
library(jsonlite)
df <- fromJSON("https://vacationwithoutacar.com/wp-admin/admin-ajax.php?action=wp_ajax_ninja_tables_public_action&table_id=2596&target_action=get-all-data&default_sorting=old_first")
> head(df)
pos bib participantsname event home g a miles km yourapproximatelocation comp projfin 51 52 53 54
1 1 17395 Gingerbread Man GVRAT US-TN M 145 275.6 443.5 Cowley Hollow 43.50% tbd 83 43 49 52
2 2 1074 Terri Biloski GVRAT CA-ON F 44 274.6 442.0 Cowley Hollow 43.30% tbd 63 59 52 52
3 3 1429 Dave Proctor GVRAT CA-AB M 39 255.3 410.8 Cowley Hollow 40.30% tbd 62 62 5 62
4 4 743 John Sharp GVRAT US-TX M 42 235.0 378.2 Reed Hollow 37.10% tbd 34 41 46 54
5 5 386 Roc Powell GVRAT US-OH M 60 226.0 363.7 Britton Hollow 35.60% tbd 35 75 63 43
6 6 322 Rob Donkersloot GVRAT AU M 60 190.7 306.9 past Deerfield 30.10% tbd 42 42 43 32
55 56 57 58 59 51_1
1 48
2 48
3 63
4 60
5 10
6 32
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句