使用AutoIT自动化多个网页

时间:2017-09-11 05:09:08

标签: autoit

$ awk -f tst2.awk input.txt
==================
Sep  8 11:35:15   pid    rss    memused_MB  oom_score_adj   name
Sep  8 11:35:15   2664    53       0.20703          -1000   auditd
Sep  8 11:35:15   2710    56       0.21875              0   dbus-daemon
Sep  8 11:35:15   2789    56       0.21875              0   xinetd
Sep  8 11:35:15   2694    61       0.23828              0   irqbalance
Sep  8 11:35:15   1828   116       0.45312          -1000   udevd
Sep  8 11:35:15   2779   203       0.79297          -1000   sshd
Sep  8 11:35:15   2680  1181       4.61328              0   rsyslogd
Sep  8 11:35:15   Out of memory: Kill process 43390 (mysql) score 1000 or sacrifice child
==================
Sep  8 11:35:15   pid    rss    memused_MB  oom_score_adj   name
Sep  8 11:35:15   2664    53       0.20703          -1000   auditd
Sep  8 11:35:15   2710    56       0.21875              0   dbus-daemon
Sep  8 11:35:15   2789    56       0.21875              0   xinetd
Sep  8 11:35:15   2694    61       0.23828              0   irqbalance
Sep  8 11:35:15   1828   116       0.45312          -1000   udevd
Sep  8 11:35:15   2779   203       0.79297          -1000   sshd
Sep  8 11:35:15   2680  1181       4.61328              0   rsyslogd
Sep  8 11:35:15   Out of memory: Kill process 43390 (mysql) score 1000 or sacrifice child

我正在使用AutoIt进行网络自动化。但是使用AutoIt只能自动完成两到三页。对于其他页面,代码无效。

有人可以帮我吗?如何自动化多个网页?

1 个答案:

答案 0 :(得分:0)

您可以使用_IEAttach()通过标题,网址,句柄或其他参数附加IE的新实例。请参阅here

Local $oIE = _IECreate("www.google.com",1,1,1,1)
_IELoadWait($oIE)
Sleep(2000)
$o_form = _IEFormGetObjByName($oIE, "f")
$element = _IEFormElementGetObjByName($o_form,"q")
_IEFormElementSetValue($element,"INDIA")
Sleep(2000)
_IEFormSubmit($o_form)
Sleep(2000)
 _IELinkClickByText($oIE, "India - Wikipedia")
 Sleep(3000)
$OIE1 = _IEAttach("India - Wikipedia")
_IELoadWait($OIE1)
Sleep(2000)
MsgBox($MB_SYSTEMMODAL,"","New Page",3)
_IELinkClickByText($OIE1,"second-most populous")