Python Forum

Full Version: Selenium Screenshots store in Database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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')
which DBMS?
Most databases allow storage of blobs (which could be an image)
I have also same problem. I'm using MySql with FireFox driver.
Using mongodb with mongoengine.