• 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
     
  • 相关阅读:
    PHP设计模式之----简单工厂模式
    PHP设计模式之----单例模式
    php排序算法
    PHP代码实现二分法查找
    Centos 7 下安装PHP7.2(与Apache搭配的安装方式)
    PHPSTORM Live-Templates变量速查表
    Centos 7 设置ip地址
    Centos 7下编译安装Apache
    Centos 7下编译安装Mysql
    apache配置Directory目录权限的一些配置
  • 原文地址:https://www.cnblogs.com/MrRead/p/9044818.html
Copyright © 2020-2023  润新知