-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
epmc_ftxt() seems not to be able to retrieve full texts anymore. I've tried a bunch of articles that should be openly available according to EuropePMC, and even a bunch that I have successfully retrieved before using this function.
Reproducible example:
library(europepmc)
pmid <- "31762656"
literature <- europepmc::epmc_search(pmid)
if (literature[1, "isOpenAccess"] == "Y") {
result <- europepmc::epmc_ftxt(literature[1, "pmid"])
}
Gives:
Request failed [404]. Retrying in 1.3 seconds...
Request failed [404]. Retrying in 1 seconds...
Error in europepmc::epmc_ftxt(literature[1, "pmid"]) :
Not Found (HTTP 404). Failed to retrieve full text..
Trying a bunch of options that have worked in the past:
library(europepmc)
pmid <- c("31762656", "32376948", "32119693")
result <- vector(mode = "list", length = length(pmid))
for (i in 1:length(pmid)) {
literature <- europepmc::epmc_search(pmid[i])
result[[i]] <- tryCatch(
{
if (any(literature[, "isOpenAccess"] == "Y")) {
result[[i]] <- europepmc::epmc_ftxt(literature[which(literature[, "isOpenAccess"] == "Y"),
"pmid"])
} else {
list()
}
},
error = function(request_failed)
{
return(list())
}
)
}
Gives:
1 records found, returning 1
Request failed [404]. Retrying in 1.4 seconds...
Request failed [404]. Retrying in 2.3 seconds...
1 records found, returning 1
Request failed [404]. Retrying in 1 seconds...
Request failed [404]. Retrying in 3.5 seconds...
1 records found, returning 1
Request failed [404]. Retrying in 1.5 seconds...
Request failed [404]. Retrying in 4 seconds...
europepmc::epmc_search() still works though, as does europepmc::epmc_details().
Metadata
Metadata
Assignees
Labels
No labels