2

I am trying to translate a webpage from Hindi to English by passing experimental options to chromedriver in R while using the rselenium package.

I am using the following setup but I am not able to translate the page automatically to English. This builds on the answer here.

eCaps <- list(prefs = list(translate_whitelists=c('hi:en'), translate=c('enabled:true')))
rd <- rsDriver(browser = "chrome",
               chromever = "84.0.4147.30",
               port = netstat::free_port(),
               extraCapabilities = eCaps)

Any help in getting this to work is much appreciated. Thanks.

  • Figured this out. The following code does the trick. `eCaps <- list(chromeOptions = list(args = c('--disable-gpu','--window-size=1920,1080', '--lang=en'), prefs = list(translate_whitelists=list('hi' = 'en'), translate=list('enabled'='true'))))` – tejendrapsingh Sep 17 '20 at 16:35
  • You should make it an answer for improved visibility (and readability) – stevec Dec 21 '20 at 11:37

0 Answers0