Dim 年, iRet, temp, hWeb, arrayData, 月, bRet, 日, arrRet, objRect, arrElement0, arrElement1, arrElement2, arrElement3, sRet1 年 = Dialog.InputBox("", "请输入年份", "", false) 年 = CInt(年) 年 = 年-1900 TracePrint(年) 月 = Dialog.InputBox("", "请输入月份", "", false) 月 = CInt(月) 月 = 月-1 日 = Dialog.InputBox("", "请输入具体几号", "", false) TracePrint($PrevResult) Mouse.Action(@ui"文本<i>_1", "left", "click", 10000, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 0, "iCursorOffsetY": 0, "sKeyModifiers": [], "sSimulate": "simulate", "bMoveSmoothly": false}) arrElement = UiElement.GetChildren(@ui"000", 1, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) Mouse.Action(arrElement[年], "left", "click", 10000, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 0, "iCursorOffsetY": 0, "sKeyModifiers": [], "sSimulate": "simulate", "bMoveSmoothly": false}) Mouse.Action(@ui"文本<i>_2", "left", "click", 10000, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 0, "iCursorOffsetY": 0, "sKeyModifiers": [], "sSimulate": "simulate", "bMoveSmoothly": false}) arrElement = UiElement.GetChildren(@ui"月", 1, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) Mouse.Action(arrElement[月], "left", "click", 10000, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 0, "iCursorOffsetY": 0, "sKeyModifiers": [], "sSimulate": "simulate", "bMoveSmoothly": false}) 日 = CInt(日) arrElement0 = UiElement.GetChildren(@ui"111111", 1, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) For j = 1 To 6 step 1 arrElement = UiElement.GetChildren(arrElement0[j], 1, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) For i = 0 To 6 step 1 arrElement1 = UiElement.GetChildren(arrElement[i], 1, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) arrElement2 = UiElement.GetChildren(arrElement1[0], 1, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) sRet = UiElement.GetAttribute(arrElement2[0], "class", {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) TracePrint($PrevResult) arrElement3 = UiElement.GetChildren(arrElement2[0], 1, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) sRet1 = UiElement.GetValue(arrElement3[1], {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) sRet1 = CInt(sRet1) TracePrint($PrevResult) bRet = Text.Exists(sRet, "other", "instr", 1, 10000, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true}) If bRet = false If sRet1 = 日 Mouse.Action(arrElement[i], "left", "click", 10000, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 0, "iCursorOffsetY": 0, "sKeyModifiers": [], "sSimulate": "simulate", "bMoveSmoothly": false}) Exit() End If End If Next Next Dim arrElement Dim sRet 日的选择(JS单击的方法) Dim temp, hWeb, sRet, iRet 日 = Dialog.InputBox("请输入天:", "Laiye Automation", "", false) 日 = CInt(日) 日 = 日-1 hWeb = WebBrowser.BindBrowser("chrome", 10000, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200}) sRet = WebBrowser.RunJS(hWeb, "function(){document.querySelectorAll(\"div[class=' cell-inner-box'],[class=' cell-inner-box'],[class='cell-weekend cell-inner-box'],[class='cell-weekend cell-today cell-inner-box'],[class='cell-festival cell-rest cell-inner-box'],[class='cell-weekend cell-work cell-inner-box'],[class='cell-weekend cell-festival cell-rest cell-inner-box'],[class='cell-selected cell-weekend cell-today cell-inner-box '],[class='cell-selected cell-inner-box'],[class='cell-selected cell-weekend cell-inner-box'],[class='cell-selected cell-festival cell-rest cell-inner-box'],[class='cell-selected cell-weekend cell-work cell-inner-box'],[class='cell-selected cell-weekend cell-festival cell-rest cell-inner-box'],[class='cell-today cell-inner-box'],[class='cell-selected cell-today cell-inner-box']\")[" & 日 & "].click();return 123}", true, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200})
标签:200,iDelayBefore,false,04,300,日历,cell,bContinueOnError,百度 From: https://www.cnblogs.com/wwzlhx/p/16717943.html