I want to right click on the link named 'CSV Summary' just to copy the link address of that CSV file because on clicking the link it starts downloading the file directly which I don't want. Attached is the code which I used to reach that page showing CSV summary, the link address of which I need to copy. code used
Asked
Active
Viewed 38 times
0
-
Use `findElement` to get the reference to the CSV Summary Link Then use `getElementAttribute` to get the `href=` attribute for that link (that's where the address is stored). See https://stackoverflow.com/questions/29855009/how-to-find-a-href-element-in-a-webpage-using-rselenium – MrFlick Aug 30 '22 at 18:30
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 30 '22 at 22:48
1 Answers
0
I see that you can call on their JSON source to get the data
library(tidyverse)
library(httr2)
"https://services.healthtech.dtu.dk/services/BepiPred-2.0/tmp/630F1ABF0000500259861910/results.json" %>%
request() %>%
req_perform() %>%
resp_body_json(simplifyVector = TRUE)
If you want to download the CSV, there is link embedded in the JSON
"https://services.healthtech.dtu.dk/services/BepiPred-2.0/tmp/630F1ABF0000500259861910/results.json" %>%
request() %>%
req_perform() %>%
resp_body_json(simplifyVector = TRUE) %>%
.$csv_summary %>%
str_c("https://services.healthtech.dtu.dk", .) %>%
download.file(url = .,
destfile = "heatlh.csv",
mode = "wb")

Chamkrai
- 5,912
- 1
- 4
- 14