我试图采取我打开的网页快照,但我需要延迟代码的第二部分,以便程序有时间打开网页
这是密码
import os
import sys
import time
import Image
import ImageGrab
import webbrowser
webbrowser.open_new(input("URL: "))
#Need to delay here
SaveDirectory=r'C:\Documents and Settings\User\My Documents\My Pictures'
ImageEditorPath=r'C:\WINDOWS\system32\mspaint.exe'
img=ImageGrab.grab()
box = (100, 100, 400, 400)
region = img.crop(box)
saveas=os.path.join(SaveDirectory,'ScreenShot_'+'.png')
img.save(saveas)
editorstring='""%s" "%s"'% (ImageEditorPath,saveas)
os.system(editorstring)
用selenium webdriver bindings for python截图:
你可以试着用时间。睡眠(秒)让程序延迟一段时间。你知道吗
相关问题 更多 >
编程相关推荐