When taking web screenshots using selenium web driver, it saved PNG screenshots correctly. So, is there a way to stored these PNG screenshots in database directly? currently I used below code
options = webdriver.ChromeOptions()
options.headless = True
driver = webdriver.Chrome('C:/Users/admin/Desktop/chromedriver.exe', options=options)
driver.get(response.url)
S = lambda X: driver.execute_script('return document.body.parentNode.scroll'+X)
driver.set_window_size(S('Width'),S('Height')) # May need manual adjustment
driver.find_element_by_tag_name('body').screenshot('./images/sample.png')
