autoit获取ie浏览器简单操作网页(GUI小工具)

需要稍稍熟悉一下autoti提供的语言,

我简单做了一个带GUI的小工具,实现根据IE标题点击页面内的LinkText

注意:使用时IE窗口是显示状态才可以获取到(可以在脚本中加入搜索IE句柄,将ie显示出来)

#include <IE.au3>
#include <MsgBoxConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>           #以上为导入的文件
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("resource access", 300, 153, 192, 124)
$Input1 = GUICtrlCreateInput("", 56, 24, 217, 21)
$Input2 = GUICtrlCreateInput("", 56, 64, 217, 21)
$Button1 = GUICtrlCreateButton("access", 32, 104, 219, 25)
$Label1 = GUICtrlCreateLabel("IE标题", 16, 24, 36, 17)
$Label2 = GUICtrlCreateLabel("链接名", 16, 64, 36, 17)
$Label3 = GUICtrlCreateLabel("-G", 285, 140, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###           #以上为创建GUI窗体

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			$inputtitle=GUICtrlRead($Input1)
			$inputlink=GUICtrlRead($Input2)          #获取控件内容
			Local $oIE = _IEAttach($inputtitle, "dialogbox")       #获取IE窗口
			_IELinkClickByText($oIE, $inputlink)                  #点击LinkText
	EndSwitch
WEnd

 

 

转载于:https://www.cnblogs.com/MrRead/p/9044818.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值