SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.19k stars 8.11k forks source link

Trouble Hosting RSelenium on shinyapps.io #13240

Closed saleforecast1 closed 9 months ago

saleforecast1 commented 9 months ago

Hey amazing community! I hope you're all doing great. :star2: I'm currently facing a bit of a roadblock with hosting RSelenium on http://shinyapps.io|shinyapps.io, and I'm reaching out to the brilliant minds here for some guidance. The Challenge: I've been working on a Shiny app that involves RSelenium for some web scraping magic. Locally, everything is smooth sailing, but when I try to host it on http://shinyapps.io|shinyapps.io, I encounter a pesky error that's causing a bit of a headache. The Error:


[2023-12-03T09:48:08.811850540+0000] Execute script: packages/build/RSelenium.sh
+ set -e
+ apt-get update -qq
W: <http://cran.rstudio.com/bin/linux/ubuntu/jammy-cran40/InRelease>: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
+ DEBIAN_FRONTEND=noninteractive
+ apt-get install -y libssl-dev phantomjs
Reading package lists...
Building dependency tree...
Reading state information...
Package phantomjs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'phantomjs' has no installation candidate## End Task Log ################################################################
Error: Unhandled Exception: Child Task 1361911030 failed: Error building image: Build exited with non-zero status: 100
Execution halted```
*Shiny Code:*
```library(shiny)
library(wdman)
library(RSelenium)
library(httr)    
library(netstat)

ui &lt;- fluidPage(
  actionButton("btn", "Click Me!"),
  textOutput("txt"),
)

server &lt;- function(input, output, session) {
  observeEvent(input$btn, {
    #connect chrome driver
    client_server &lt;- rsDriver(
      browser = "chrome",
      chromever = "119.0.5735.90",
      verbose = FALSE,
      port = free_port(),
    )

    # connect remote driver to client
    remDr &lt;- client_server$client
    remDr$navigate("<http://www.google.com>")
    remDr$maxWindowSize()
    title &lt;- remDr$getTitle()
    output$txt &lt;- renderText(as.character(title))
    # clean up
    remDr$quit()
  })
}

shinyApp(ui, server)```
*What I've Tried:*
• Checked dependencies locally, and everything is installed.
• Used the latest version of RSelenium.
• Set up appropriate configurations for the Chrome driver.
*My Ask:*
If anyone has faced a similar challenge or has experience with hosting RSelenium on <http://shinyapps.io|shinyapps.io>, your insights would be a game-changer! :rocket:
*How You Can Help:*
• Share your experiences, tips, or workarounds.
• Suggest alternative solutions or optimizations.
• Point me to relevant resources or documentation.
I'm open to any suggestions that could help me overcome this hurdle and make this project a success. Your expertise and support are immensely appreciated! :raised_hands:
Thank you in advance for being an awesome community. Let's crack this code together!
Happy coding,
SaleForecast

[Slack Message](https://seleniumhq.slack.com/archives/C0ABCS03F/p1701677183947109)
github-actions[bot] commented 9 months ago

💬 Please ask questions at:

titusfortner commented 9 months ago

We do not manage RSelenium. Try https://github.com/ropensci/RSelenium

Also, phantomjs was deprecated many years ago, so you might just be working with really old code examples.

github-actions[bot] commented 8 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.