How do you use webshot to take a screenshot of a portion (single tabpanel) of a shiny app?



Moved from Shiny Gallery Thumbnails

I was trying to include webshot in my app to take a screenshot of single section of the app. I did not succeeded.
For example, is it possible to take a screenshot of only the second tab (tabPanel) of a navbarPage? I did not see anything similar in the documentation.

Shiny Gallery Thumbnails

Have a look at the Usage instructions,

You can also get screenshots of a portion of a web page using CSS selectors. If there are multiple matches for the CSS selector, it will use the first match.

webshot("", "r-sidebar.png", selector = ".sidebar")

If you supply multiple CSS selectors, it will take a screenshot containing all of the selected items.

webshot("", "r-selectors.png",
      selector = c("#getting-started", "#news"))

The clipping rectangle can be expanded to capture some area outside the selected items:

webshot("", "r-expand.png",
      selector = "#getting-started",
      expand = c(40, 20, 40, 20))


Thanks for your feedback!

I saw that webpage, but I tried with inspect element to figure out what was the selector id but could not find it.



I have an app on aws-EC2 and I want to take a webshot of the second tab only.