from PIL import Image from io import BytesIO def get_vc_image(element): image = element.screenshot_as_png imageStream = BytesIO(image) im = Image.open(imageStream) return im