Ниже приведен фрагмент моего кода:
Код: Выделить всё
image_data = self.driver.get_screenshot_as_png()
screenshot = Image.open(BytesIO(image_data))
screenshot.save('screenshot.png')
element = self.driver.find_element(By.CSS_SELECTOR,'myselect')
top = element.location['y']
bottom = element.location['y'] + element.size['height']
left = element.location['x']
right = element.location['x'] + element.size['width']
result = screenshot.crop((left,top,right,bottom))
Итак, как я могу получить реальную позицию изображения, которое я хочу разместить на веб-странице?
Подробнее здесь: https://stackoverflow.com/questions/792 ... n-web-page
Мобильная версия