Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IEDriverServer screenshot
#1
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

[Image: 96a8e0eb90cbt.jpg] - this original

[Image: c59ee5624d9et.jpg]

-this resize

[Image: b298f3499b1at.jpg]
- this screenshot
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyautogui.screenshot region is not working alexlu 6 6,382 Jun-04-2020, 10:46 AM
Last Post: alexlu
  What is the best way to search for a pixel in a screenshot? TheZadok42 1 2,522 May-15-2020, 12:37 PM
Last Post: scidam
  Want to take a Screenshot from a File in Linux dhiliptcs 2 2,518 Oct-21-2019, 01:22 PM
Last Post: dhiliptcs
  Screenshot of specific window kainev 10 19,110 Nov-30-2018, 03:07 PM
Last Post: kainev
  datetime with every screenshot name evilcode1 7 5,428 Aug-27-2018, 06:01 PM
Last Post: buran
Question [Help] Convert integer to Roman numerals? {Screenshot attached} vanicci 10 9,030 Aug-06-2018, 05:19 PM
Last Post: vanicci
  [Help] sorted() in while loop with user's input() {Screenshot attached} vanicci 5 3,952 Aug-04-2018, 08:59 PM
Last Post: vanicci
Question [Help] How to end While Loop using counter? {Screenshot attached} vanicci 2 3,052 Aug-02-2018, 10:09 PM
Last Post: vanicci

Forum Jump:

User Panel Messages

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