I want to take screenshot from youtube using RSelenium and phantomjs. I have this code:
library(RSelenium)
library(wdman)
rPJS <- wdman::phantomjs(port = 4680L)
rPJS$process$is_alive()
rJS <- RSelenium::remoteDriver(browserName="phantomjs", port=4680L)
rJS$open()
rJS$navigate("https://www.youtube.com/watch?v=fKc050dvNIE")
rJS$getTitle()
rJS$screenshot(file = 'test.png')
rJS$close()
rPJS$stop()
Everything seems to work fine, however the image test.png looks like this:
I tested it with "https://www.google.com" and the image looks fine:
Any idea how to make it work for youtube? Thanks.

