I want to take screenshot of several links belonging to youtube. I want to take screenshot of the webpage where it will play the video and then take screenshot or take the screenshot without playing but all this has to happen using python or R but they shouldn't open the browser. it should all happen in the backend.
Any help on this will be great.
Thank you in advance.
I have tried opening the link and taking the screenshot using both R and python and it does take the screenshot without opening browser. But the video screenshot is black with an error which I don't want.
code in R library(webshot) webshot("https://www.youtube.com/watch?v=Nym5stAJAt8","test.png")
code in python from selenium import webdriver driver=webdriver.PhantomJS() driver.set_window_size(1120, 550) driver.get("https://www.youtube.com/watch?v=Nym5stAJAt8") driver.save_screenshot("screenshot.png")