【问题标题】:Internet Explorer automation form postInternet Explorer 自动化表单发布
【发布时间】:2012-07-11 04:18:25
【问题描述】:

我正在尝试使用 vbscript 加载页面。然后我在其输入字段中输入一些虚拟值并尝试提交。

这是它的代码:

    Dim ie
Set ie = WScript.CreateObject("InternetExplorer.Application")
ie.navigate("http://somepage.com")

ie.width = 900
ie.height = 600
ie.Visible = 1

WScript.sleep(5000)

'Home page of user is loaded.
'Now find the field containing mobile number and type message




    Dim nameField, messageField
    set nameField = ie.document.getElementById("MobileNos")'this line throws error
    nameField.value = "somebody"

    messageField = ie.document.getElementById("Message")
    messageField.value = "Hi"

    'Sending the message
    ie.document.frmpostcomment.submit()

但每当我尝试运行此代码时,它不会发布评论,而是刷新页面。

提前致谢。

【问题讨论】:

    标签: internet-explorer vbscript automation


    【解决方案1】:

    在表格的发布期间我应该写的

    ie.document.frmpostcomment.submitbtn.click
    

    这对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-14
      相关资源
      最近更新 更多