Using pagedown::chrome_print() in kaggle notebook

29 views Asked by At

I have been trying to use pagedown::chrome_print('trial.html') on a kaggle notebook but doesn't seem to work for me. first I ran into this error:

Error in find_chrome(): Cannot find Chromium or Google Chrome
Traceback:

1. pagedown::chrome_print("trial.html")
2. find_chrome()
3. stop("Cannot find Chromium or Google Chrome")

I tried installing chrome like this:

system("sudo apt-get install selenium")
system("sudo apt-get update")
system("sudo apt install -y chromium-chromedriver")
system("sudo cp /usr/lib/chromium-browser/chromedriver /usr/bin")

trying to knit again I get the error Error in is_remote_protocol_ok(debug_port, verbose = verbose): Cannot find headless Chrome after 20 attempts Traceback:

1. pagedown::chrome_print("trial.html")
2. is_remote_protocol_ok(debug_port, verbose = verbose)
3. stop("Cannot find headless Chrome after ", max_attempts, " attempts")

how can I set up this right, There are a couple of solutions on the internet but most of them are Python-based.

My sessionInfo

`> R version 4.0.5 (2021-03-31) Platform: x86_64-pc-linux-gnu (64-bit)

Running under: Ubuntu 20.04.6 LTS

Matrix products: default BLAS:
/usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils
datasets methods base

other attached packages: [1] pagedown_0.20 lubridate_1.9.3
forcats_1.0.0 [4] stringr_1.5.1 dplyr_1.1.4
purrr_1.0.2 [7] readr_2.1.4 tidyr_1.3.0
tibble_3.2.1 [10] ggplot2_3.4.4 tidyverse_2.0.0
googlesheets4_1.1.1 [13] googledrive_2.1.1 bigrquery_1.4.2
httr_1.4.7

loaded via a namespace (and not attached): [1] Rcpp_1.0.11
ps_1.7.5 assertthat_0.2.1 [4] digest_0.6.33
utf8_1.2.4 IRdisplay_1.1.0.9000 [7] R6_2.5.1
cellranger_1.1.0 repr_1.1.6.9000 [10] evaluate_0.23
pillar_1.9.0 rlang_1.1.2 [13] curl_5.1.0
uuid_1.1-1 mongolite_2.7.3 [16] servr_0.27
bit_4.0.5 munsell_0.5.0 [19] compiler_4.0.5
httpuv_1.6.12 xfun_0.41 [22] pkgconfig_2.0.3
askpass_1.2.0 base64enc_0.1-3 [25] htmltools_0.5.7
openssl_2.1.1 tidyselect_1.2.0 [28] fansi_1.0.5
crayon_1.5.2 tzdb_0.4.0 [31] dbplyr_2.4.0
withr_2.5.2 later_1.3.1 [34] grid_4.0.5
jsonlite_1.8.8 gtable_0.3.4 [37] lifecycle_1.0.4
DBI_1.1.3 magrittr_2.0.3 [40] scales_1.3.0
cli_3.6.1 stringi_1.8.2 [43] promises_1.2.1
fs_1.6.3 generics_0.1.3 [46] vctrs_0.6.5
IRkernel_1.3.2.9000 tools_4.0.5 [49] bit64_4.0.5
glue_1.6.2 hms_1.1.3 [52] processx_3.8.2
fastmap_1.1.1 timechange_0.2.0 [55] colorspace_2.1-0
gargle_1.5.2 pbdZMQ_0.3-10

0

There are 0 answers