AutoIt3示例

2020-11-09  本文已影响0人  MicoCube
$chrome_path = "C:\Users\MicoCube\AppData\Local\Google\Chrome\Application\chrome.exe"

;;打开窗口
Local $val = Run($chrome_path,"",@SW_SHOWMAXIMIZED)
;;登录窗口显示
WinWaitActive("[CLASS:Chrome_WidgetWin_1]")
;; 休息2000毫秒
Sleep(2000)
;; 移动窗口
;;WinMove("[CLASS:Chrome_WidgetWin_1]", "打开新的标签页 - Google Chrome", 0, 0,1200,740,2);
;; 休息500毫秒
Sleep(500)
;; 窗口PID
;;MsgBox(0, "PID:", $val);

;;清除cookie
Send("chrome://settings/clearBrowserData");
send("{enter}");
Sleep(2000)
MouseClick("left",837,645,2);
;;
Sleep(2000)

;;打开浏览页面
Send("^t");
Sleep(500)
Send("https://www.baidu.com");
Send("{enter}");
Sleep(2000)



MouseClick("left",473,286,1);
Send("java");
Send("{enter}");
Sleep(2000)

;;判断窗口是否存在
If WinExists("[CLASS:Chrome_WidgetWin_1]") Then
    MsgBox(0, "info", "窗口存在")
Else
    MsgBox(64, "error", "窗口不存在")
 EndIf

MsgBox(0, "PID:", $val);
ProcessClose($val)
MsgBox(0, "已关闭:", $val);
#include <Constants.au3>

Local $p = Run(@ComSpec & " /c ping 6san.com","",@SW_HIDE, 15)
Local $line
ProcessWaitClose($p)
While 1
$line = StdoutRead($p)
If @error Then ExitLoop
MsgBox(0,"STDOUT read:", $line)
Wend
上一篇下一篇

猜你喜欢

热点阅读