import time
import datetime
from apscheduler.schedulers.blocking import BlockingScheduler
#from apscheduler.schedulers.background import BackgroundScheduler
from selenium import webdriver
import win32api
import win32gui
import win32con
import win32clipboard as clipboard
from PIL import Image
from io import BytesIO
sched = BlockingScheduler()
#sched = BackgroundScheduler()#后台
import win32clipboard as w
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'
' AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/79.0.3945.117 Safari/537.36' }
web = {
'百度': 'https://www.baidu.com/',
'网易': 'https://www.163.com/',
'新浪': 'https://www.sina.com.cn/'
}
#定义指定图片文件复制到剪贴板函数##########
def pic_ctrl_c(pathfile):
img = Image.open(pathfile)
output = BytesIO()#如是StringIO分引起TypeError: string argument expected, got 'bytes'
img.convert("RGB").save(output, "BMP")# 以BMP格式保存流
data = output.getvalue()[14:]#bmp文件头14个字节丢弃
output.close()
clipboard.OpenClipboard() #打开剪贴板
clipboard.EmptyClipboard() #先清空剪贴板
clipboard.SetClipboardData
selenium 实现自动每小时截图外加保存,并通过本地微信发送给指定人(no wechat)
于 2021-08-05 11:49:39 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)