wdpar icon indicating copy to clipboard operation
wdpar copied to clipboard

Error with wdpa_fetch()

Open jeffreyhanson opened this issue 10 months ago • 1 comments

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 avatar Apr 22 '24 21:04 jeffreyhanson

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

jeffreyhanson avatar Apr 22 '24 22:04 jeffreyhanson

Fixed by #78

jeffreyhanson avatar Apr 25 '24 06:04 jeffreyhanson

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

duboisl-afd avatar Jun 14 '24 10:06 duboisl-afd

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

jeffreyhanson avatar Jun 16 '24 20:06 jeffreyhanson

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

duboisl-afd avatar Jun 17 '24 16:06 duboisl-afd

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")

jeffreyhanson avatar Jun 17 '24 20:06 jeffreyhanson

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

duboisl-afd avatar Jun 18 '24 11:06 duboisl-afd

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()

jeffreyhanson avatar Jun 19 '24 01:06 jeffreyhanson