抓取生产工单,赚取发料异常
This commit is contained in:
56
browser_login/auto_navigate_report.py
Normal file
56
browser_login/auto_navigate_report.py
Normal file
@@ -0,0 +1,56 @@
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
from login import get_page
|
||||
|
||||
page = get_page(port=9222)
|
||||
|
||||
print("正在打开主页...")
|
||||
page.get("https://yunmes.tftykj.cn/")
|
||||
page.wait.load_start()
|
||||
time.sleep(2)
|
||||
|
||||
print("正在打开 生产工单发料异常检查报表...")
|
||||
try:
|
||||
m1 = page.ele('text=自定义报表管理')
|
||||
if m1:
|
||||
print("点击第一级...")
|
||||
m1.click()
|
||||
time.sleep(1)
|
||||
|
||||
# 找到展开后的第二级
|
||||
for m in page.eles('text:自定义报表管理'):
|
||||
try:
|
||||
m.click()
|
||||
except:
|
||||
pass
|
||||
time.sleep(1)
|
||||
|
||||
for m in page.eles('text:自定义报表'):
|
||||
if m.text == '自定义报表':
|
||||
try:
|
||||
m.click()
|
||||
print("点击第三级...")
|
||||
except:
|
||||
pass
|
||||
time.sleep(2)
|
||||
|
||||
ele = page.ele('text:生产工单发料异常检查报表', timeout=5)
|
||||
if ele:
|
||||
print("找到报表行,选中...")
|
||||
ele.parent('tag:tr').click()
|
||||
time.sleep(0.5)
|
||||
btn = page.ele('text=进入自定义报表')
|
||||
if btn:
|
||||
print("点击进入自定义报表...")
|
||||
btn.click()
|
||||
time.sleep(2)
|
||||
print("成功进入报表!")
|
||||
else:
|
||||
print("未找到进入按钮。")
|
||||
else:
|
||||
print("未能找到 '生产工单发料异常检查报表'")
|
||||
except Exception as e:
|
||||
print(f"执行过程中发生异常: {e}")
|
||||
|
||||
Reference in New Issue
Block a user