Automated Programmatic Website Screenshots in R with {webshot} [Video Tutorial]
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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")
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.