#coding: utf-8
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
import time,os
import selenium.webdriver
from PIL import Image
#打开目标地址
driver=selenium.webdriver.Firefox()
driver.get(" http://www.51testing.com/html/index.html")
#找到目标元素
photo=driver.find_element_by_xpath(".//*[@id='pagetitle']/div[1]/a/img")
time.sleep(3)
#获取元素所处的位置,以x,y标识元素左上定点的位置
location=photo.location
print (location)
#获取元素的高和宽,以height标识高,以width标识宽
size=photo.size
print (size)
#截取全屏图像并保存到本地路径
driver.save_screenshot("photo.png")
#打开所截取的图像
im = Image.
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
import time,os
import selenium.webdriver
from PIL import Image
#打开目标地址
driver=selenium.webdriver.Firefox()
driver.get(" http://www.51testing.com/html/index.html")
#找到目标元素
photo=driver.find_element_by_xpath(".//*[@id='pagetitle']/div[1]/a/img")
time.sleep(3)
#获取元素所处的位置,以x,y标识元素左上定点的位置
location=photo.location
print (location)
#获取元素的高和宽,以height标识高,以width标识宽
size=photo.size
print (size)
#截取全屏图像并保存到本地路径
driver.save_screenshot("photo.png")
#打开所截取的图像
im = Image.