【问题标题】:submitting form in auto it自动提交表单
【发布时间】:2015-08-14 17:58:45
【问题描述】:

问题是: 我在 html 中有表单,其中包含:-

"two text-box"" bottom to submit"

我想要的是: 使脚本自动添加一些文本并提交表单,而无需打开 Internet Explorer 窗口(仅脚本)。

我尝试实现get和post,但失败了

#include<ie.au3>
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "http://localhost/2.html", False)
_IELinkClickByText( $oHTTP , "submit")
$oHTTP.Send()

【问题讨论】:

    标签: html autocomplete automation autoit


    【解决方案1】:

    您可以使用 WinHttp.au3 - https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ 检查 _WinHttpSimpleFormFill 填写表单然后提交

    【讨论】:

      【解决方案2】:

      带有“_IE”前缀的函数不用于 WinHttp 对象。因此,您不能调用 _IELinkClickByText 函数。

      使用 IE UDF 提交表单的示例:

      #include <IE.au3>
      Local $oIE = _IECreate('http://localhost/2.html')
      Local $oForm = _IEFormGetCollection($oIE, 0)
      _IEFormSubmit($oForm)
      

      但是如果你想使用 WinHttp,你应该使用 POST 方法而不是 GET

      【讨论】:

        猜你喜欢
        • 2015-09-24
        • 2018-01-15
        • 2013-03-15
        • 2011-02-05
        • 2010-11-25
        • 2015-05-14
        • 1970-01-01
        相关资源
        最近更新 更多