Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot of selected CSS element #187

Closed
rpodcast opened this issue Apr 12, 2018 · 3 comments
Closed

Screenshot of selected CSS element #187

rpodcast opened this issue Apr 12, 2018 · 3 comments

Comments

@rpodcast
Copy link
Contributor

rpodcast commented Apr 12, 2018

I've been using the webshot package for some side projects and the capability of taking a screenshot of a particular element with CSS selectors (i.e. with webshot("https://www.r-project.org/", "r-sidebar.png", selector = ".sidebar") is really nice. Is it possible to extend this feature to app$takeScreenshot()?

@rpodcast
Copy link
Contributor Author

I've done some investigation on ways to integrate this feature, but I'm not sure the optimal approach. In case it helps here's what I've found:

  • shinytest currently relies on webdriver to create screenshots via the takeScreenshot() method. Long ago it looks like there was some work to implement a element selection parameter for the screenshot method in webdriver per rstudio/webdriver#13, but the implementation did not perform as expected.
  • If there was a way to invokewebshot() on the already running phantomjs session serving the shiny app, then it seems like that could be a solution. Of course I have no idea how difficult it would be to accomplish this.

@hadley
Copy link
Member

hadley commented Aug 8, 2020

Duplicate of #260. We should have an implementation of this in the near future.

@hadley hadley closed this as completed Aug 8, 2020
@stla
Copy link

stla commented Sep 22, 2021

Hello,

This near future has coming now ? I would like to take a snapshot of a plot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants