IEDriverServer screenshot - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: IEDriverServer screenshot (/thread-28274.html) |
IEDriverServer screenshot - ABVSVL - Jul-12-2020 Hi. How can I do screenshot from IEDriverServer ? I have code from selenium import webdriver browser = webdriver.Ie('C:\selenium\IEDriverServer.exe') browser.get('http://www.google.com/') browser.get_screenshot_as_file('IETEST.png') browser.quit() after running the code, the program starts IE 11 but the screenshot does not. What do I need to do to get a screenshot? IE 11 window does not close. remains open test ================================================================================== I managed to make a screenshot as it should !! ================================================================================== I have other problem =))) from Screenshot import Screenshot_Clipping from selenium import webdriver import PIL.ImageChops as ich from PIL import Image browser = webdriver.Ie('C:\selenium\IEDriverServer_Win32_3.4.0\IEDriverServer.exe') ======================================================= ob=Screenshot_Clipping.Screenshot() url = "http://" browser.get(url) browser.set_window_size(1920, 1080) img_url=ob.full_Screenshot(browser, save_path=r'.', image_name='aptekaIE.png') print(img_url) browser.close() browser.quit() ----------------------------------------------------------- image1 = Image.open('aptekaIE.png') a = image1.size print('Скриншот1', a) #--------------------------------------------------------------------------####### photo = Image.open('test11.jpg') #image2.resize(image1.size, Image.ANTIALIAS) c = photo.size print('оригинал', c) #-------------------------------------------------------------------------####### size=(a) out = photo.resize(size) out.save('new1.png') #--------------------------------------------------------------------------########### image2 = Image.open('new1.png') b = image2.size print ('a', a, 'b', b) a = ich.overlay(image1=image1, image2=image2).save('rezultat99.png') on googlechrome this works fine. In internetExplorer does not compare pictures. takes a screenshot of all the pages and tries to compare it with the original. I get an error: Traceback (most recent call last): File "C:/Users/Professional/PycharmProjects/automtest/IE.py", line 40, in <module> a = ich.overlay(image1=image1, image2=image2).save('rezultat99.png') File "C:\Users\Professional\PycharmProjects\automtest\venv\lib\site-packages\PIL\ImageChops.py", line 173, in overlay return image1._new(image1.im.chop_overlay(image2.im)) ValueError: images do not match what am I doing wrong ? I have a picture. different sizes. I am taking a screenshot from the site. (the screenshot is smaller than the original) The original file I'm trying to set the screenshot parameters. and then I try to compare two pictures. everything works fine in Chrome. but with IE fails - this original -this resize - this screenshot |