prioritizr / wdpar

Interface to the World Database on Protected Areas
https://prioritizr.github.io/wdpar
GNU General Public License v3.0
37 stars 5 forks source link

Error with wdpa_fetch() #77

Closed jeffreyhanson closed 4 months ago

jeffreyhanson commented 4 months ago

It seems there have been changes to the Protected Planet website that have broken the wdpa_fetch() function. So, I need to update this function so that it works again. Here's a rerex:

library(wdpar)
x <- wdpa_fetch("LIE")
#> Error in session_makeRequest(self, private, endpoint, data, params, headers) : 
#>   Unable to find element with css selector '.download__trigger'
jeffreyhanson commented 4 months ago

Actually, it seems that the functions for navigating the Protected Planet website using the webdriver package no longer work on my computer.

jeffreyhanson commented 4 months ago

Fixed by #78

duboisl-afd commented 2 months ago

Hi, I get the same error message when I try to use wdpa_fetch. How can I fix this?

jeffreyhanson commented 2 months ago

Hi @duboisl-afd, could you please try installing the latest developmental version of the package from GitHub and see if that fixes it? I think I fixed this in a an earlier patch, but I haven't submitted an update to CRAN yet (so the CRAN version isn't currently working). To install the GitHub version of the package, see https://github.com/prioritizr/wdpar?tab=readme-ov-file#package-installation

duboisl-afd commented 2 months ago

Hi, I tried with the same result... but i am also using R studio in docker so maybe my error is related to this.

jeffreyhanson commented 2 months ago

Thanks for trying that. Maybe you're on a slow internet connection? I've made a branch with an extra step to wait for the page to load when wdpar is looking for the WDPA download links. Can you please try installing it and trying it again? To install it, please use remotes::install_github("prioritizr/wdpar@extra-wait")

duboisl-afd commented 2 months ago

Thanks for your help. I tried as well but i'm still getting the same error message.

jeffreyhanson commented 2 months ago

Ah, sorry about that. Could you please share your session info after loading the package? E.g., whats the output from this:

library(wdpar)
sessionInfo()