Automated Programmatic Website Screenshots in R with {webshot} [Video Tutorial]

In this video tutorial, We explore the R package {webshot} by Winston Chang. This package internally uses phantom js to capture screenshot of web pages / websites, Shiny Applications, RMarkdown documents.

{webshot} also lets you take screenshot of a particular viewport or a section of website selected by css selector.

Youtube: https://youtu.be/oQKwd1cgiq4

Please subscribe and leave a comment if you have any feedback. I’m new for this Video making so any suggestion/feedback to improve would be a great benefit!

Please create an R project before trying this out, it makes life simpler in dealing with directories.

Code

Install package from CRAN using install.packages("webshot"). Reference - https://github.com/wch/webshot

library(webshot)

# webshot::install_phantomjs()

webshot(url = "https://news.ycombinator.com/", file = "hn.png",
        zoom = 2)


webshot(url = "https://news.ycombinator.com/", file = "hn.pdf")

webshot(url = "https://www.anaconda.com/",
        selector = ".hero-main",
        file = "anaconda.png")
 
comments powered by Disqus