Git Product home page Git Product logo

Comments (11)

johndharrison avatar johndharrison commented on September 17, 2024 1

Try removing the phantomjs versions and retrying:

binman::rm_platform("phantomjs")
wdman::selenium(retcommand = TRUE)

If the error persists something is blocking/impeding the download of the zip files from url's such as:

https://api.bitbucket.org/2.0/repositories/ariya/phantomjs/downloads/phantomjs-2.0.0-windows.zip

from wdman.

johndharrison avatar johndharrison commented on September 17, 2024

@msgoussi can you try running the command as follows:

selCommand <-  httr::with_config(httr::config( ssl_verifypeer = 0L ), wdman::selenium(retcommand = TRUE))

or you can set session wide:

httr::set_config(httr::config(ssl_verifypeer = 0L))
selCommand <-  wdman::selenium(retcommand = TRUE)

from wdman.

msgoussi avatar msgoussi commented on September 17, 2024

I know it is network issue, since our IT team is having an aggressive firewall because the virus attach on Saudi Arabia, so I am trying to solve this problem via them.

from wdman.

johndharrison avatar johndharrison commented on September 17, 2024

The YAML file outlining the download of phantomjs is as follows:

> readLines(system.file("yaml", "phantomjs.yml", package = "wdman"))
 [1] "name: phantomjs"                                                                          
 [2] "predlfunction:"                                                                           
 [3] "  \"binman::predl_bitbucket_downloads\":"                                                 
 [4] "    url: https://api.bitbucket.org/2.0/repositories/ariya/phantomjs/downloads?pagelen=100"
 [5] "    platform:"                                                                            
 [6] "    - linux64"                                                                            
 [7] "    - linux32"                                                                            
 [8] "    - windows"                                                                            
 [9] "    - macosx"                                                                             
[10] "    history: 3"                                                                           
[11] "    appname: \"phantomjs\""                                                               
[12] "    platformregex:"                                                                       
[13] "    - \"(?!.*-symbols)linux-x86_64\""                                                     
[14] "    - \"(?!.*-symbols)linux-i686\""                                                       
[15] "    - \"windows\""                                                                        
[16] "    - \"(?!.*-symbols)macos\""                                                            
[17] "dlfunction:"                                                                              
[18] "  \"binman::download_files\": []"                                                         
[19] "postdlfunction:"                                                                          
[20] "  \"binman::unziptar_dlfiles\":"                                                          
[21] "    chmod: TRUE"  

It calls bitbucket:

https://api.bitbucket.org/2.0/repositories/ariya/phantomjs/downloads?pagelen=100

so looks like the issues are with the certificates being used for this site.

I am guessing this command

bburl <- "https://api.bitbucket.org/2.0/repositories/ariya/phantomjs/downloads?pagelen=100"
jsonlite::fromJSON(bburl)

is returning the error.

from wdman.

msgoussi avatar msgoussi commented on September 17, 2024

Yes indeed, it is returning error and I am stuck.

from wdman.

johndharrison avatar johndharrison commented on September 17, 2024

Unfortunately jsonlite::fromJSON does not pass options to the underlying curl package which is performing the download. You can try mocking the curl::new_handle function:

my_new_handle <- function(...){
  print("mocking")
  h <- .Call(curl:::R_new_handle, PACKAGE = "curl")
  curl:::handle_setopt(h, ..., ssl_verifypeer = FALSE)
  h
}
testthat::with_mock(
  `curl::new_handle` = my_new_handle,
  {
    selCommand <-  wdman::selenium(retcommand = TRUE)
  }
)

from wdman.

msgoussi avatar msgoussi commented on September 17, 2024

It is not working, but IT team will work on it today and I will inform you with the updates.
Sorry for disturbing you

from wdman.

msgoussi avatar msgoussi commented on September 17, 2024

IT team worked on the problem as follows:
they managed to run the following commands without any problems
readLines(system.file("yaml", "phantomjs.yml", package = "wdman"))
bburl <- "https://api.bitbucket.org/2.0/repositories/ariya/phantomjs/downloads?pagelen=100"
jsonlite::fromJSON(bburl)

however when i run
wdman::selenium(retcommand = TRUE)
checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
Error in if (file.access(phantompath, 1) < 0) { :
argument is of length zero

I opened the folder C:\Users\310677\AppData\Local\binman\binman_phantomjs\windows
I found three folders (2.0.0, 2.1.1 and 2.5.0) which contanis phantomjs-version-windows zip file with size 0KB.

Please advice.

from wdman.

msgoussi avatar msgoussi commented on September 17, 2024

John
I run httr::with_config(config(ssl_verifypeer=0L),wdman::selenium(retcommand=TRUE))
and it downloading three different version of phantomjs
and it working.
Tomorrow, I will test the rsDriver()
Thank you very much for your support and help.

from wdman.

johndharrison avatar johndharrison commented on September 17, 2024

Happy to help

from wdman.

Andrevw2812 avatar Andrevw2812 commented on September 17, 2024

Try removing the phantomjs versions and retrying:

binman::rm_platform("phantomjs")
wdman::selenium(retcommand = TRUE)

If the error persists something is blocking/impeding the download of the zip files from url's such as:

https://api.bitbucket.org/2.0/repositories/ariya/phantomjs/downloads/phantomjs-2.0.0-windows.zip

I know this is a long time after this issue was raised, but this actually helped me and resolved my problems. Thank you!

from wdman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.