init
This commit is contained in:
0
hik_uptime/__init__.py
Normal file
0
hik_uptime/__init__.py
Normal file
40
hik_uptime/main.py
Normal file
40
hik_uptime/main.py
Normal file
@ -0,0 +1,40 @@
|
||||
import pyautogui
|
||||
import pytesseract
|
||||
|
||||
|
||||
# # ws = pygetwindow.getAllWindows()
|
||||
# # for x in ws:
|
||||
# # print(x.title)
|
||||
#
|
||||
# wd = pygetwindow.getWindowsWithTitle("PowerShell")
|
||||
# print(wd[0])
|
||||
# wd[0].activate()
|
||||
# wd[0].maximize()
|
||||
# screenshot = pyautogui.screenshot("screenshot.png")
|
||||
# print(screenshot)
|
||||
# print(pytesseract.get_languages())
|
||||
# result = pytesseract.image_to_string(screenshot)
|
||||
# # print(result)
|
||||
|
||||
def get_status():
|
||||
window = pyautogui.getWindowsWithTitle("Mozilla Firefox")
|
||||
|
||||
window = window[0]
|
||||
window.maximize()
|
||||
window.activate()
|
||||
# pyautogui.click(900, 140)
|
||||
# clipboard.copy("网络")
|
||||
# pyautogui.hotkey('ctrl', 'a')
|
||||
# pyautogui.hotkey('ctrl', 'v')
|
||||
# pyautogui.press('enter')
|
||||
# pyautogui.click(x=window.width // 2, y=window.height // 2)
|
||||
screenshot = pyautogui.screenshot()
|
||||
screenshot = screenshot.crop((313, 46, 1118, 79))
|
||||
screenshot.save('screenshot.png')
|
||||
result = pytesseract.image_to_string(screenshot)
|
||||
print(result)
|
||||
# pyautogui.click(1920, 20)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
get_status()
|
BIN
hik_uptime/screenshot.png
Normal file
BIN
hik_uptime/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user