How to zoom out page using RSelenium library in R?

Viewed 384

I am trying to write a web-scraper using RSelenium Library in R. The last step of my work includes taking screenshot of a table on web page. To fit the whole table into the window I should zoom out the web browser (in that case it's firefox). I tried to use:

webElem <- remDR$findElement("css", "body")
webElem$clickElement()
webElem$sendKeysToElement(list(key = "control", "-"))

however it doesn't work. I saw also this thread: Zoom out shiny app at default in browser and found there promising fragment of code: library(shiny)

# Define UI for application that draws a histogram
ui <- shinyUI(fluidPage(
   tags$style("
          body {
    -moz-transform: scale(0.8, 0.8); /* Moz-browsers */
    zoom: 0.8; /* Other non-webkit browsers */
    zoom: 80%; /* Webkit browsers */
}
              "),

I have no idea if it's possible to do something similiar in R Selenium and how to implement css scale modification in RSelenium. Iwould appreciate hints from someone more experienced with R.

1 Answers
Related