1

We are trying to start a Shiny script (ideally hosted on shinyapps.io) using a separate Python script which needs to get the results.

Superficially it appears this would be possible given that the interface is web-based - but it is unclear from the code whether a GET or POST invocation could actually trigger the Shiny script. Additionally, it is unclear to us whether we would actually be able to "screen scrape" the results of the Shiny script using Python.

Another SO question attempted this but they apparently gave up and reverted to invoking the Shiny script from a command-line.

When we do a view page source on a Shiny script - we see lots of Javascript so it is unclear where the "hooks" might be to trigger the Shiny script to run (like one would expect in a GET or a POST.)

Is this possible? If so how?

Praxiteles
  • 5,802
  • 9
  • 47
  • 78
  • Since a great portion of Shiny depends on client-side Javascript, it may not work using simply GET or POST (it will need a Javascript engine to run the Javascripts). You can probably use something like `Selenium` though. – Xiongbing Jin May 24 '16 at 19:18
  • How about to try [Plumber](https://github.com/trestletech/plumber), or combine both. You can get GET requests from Shiny, not sure about POST though and run Python like `output = system2("python", args=paste(path, 'script.py', sep = ""), stdout=TRUE)` `print(output)` – Dogan Askan Apr 29 '17 at 02:58

0 Answers0