Python Forum
Selenium Screenshots store in Database
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium Screenshots store in Database
#1
Question 
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')
Reply
#2
which DBMS?
Most databases allow storage of blobs (which could be an image)
Reply
#3
I have also same problem. I'm using MySql with FireFox driver.
Reply
#4
Using mongodb with mongoengine.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with screenshots for each 'div class' paunshotts 0 373 Feb-05-2024, 10:19 AM
Last Post: paunshotts
  Store Screenshot Selenium + MongoDB Nuwan16 9 3,603 Aug-18-2020, 03:57 AM
Last Post: ndc85430
  [split] Pytest-html add screenshots help rafiPython1 1 7,983 Apr-30-2020, 07:16 PM
Last Post: Gourav
  Taking screenshots with http authentication with username and password from website onenessboy 3 4,110 Nov-30-2018, 04:17 AM
Last Post: onenessboy
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,628 Nov-03-2017, 08:41 PM
Last Post: metulburr
  Visiting websites and taking screenshots implicitly? bigmit37 4 4,442 May-01-2017, 04:26 PM
Last Post: bigmit37

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020