Python Forum
Selenium Screenshots store in Database - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Selenium Screenshots store in Database (/thread-30093.html)



Selenium Screenshots store in Database - Nuwan16 - Oct-04-2020

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')



RE: Selenium Screenshots store in Database - Larz60+ - Oct-04-2020

which DBMS?
Most databases allow storage of blobs (which could be an image)


RE: Selenium Screenshots store in Database - dsuk - Oct-05-2020

I have also same problem. I'm using MySql with FireFox driver.


RE: Selenium Screenshots store in Database - Nuwan16 - Oct-05-2020

Using mongodb with mongoengine.