VBscript Web Form Automation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    VBscript Web Form Automation


    I'm trying to create a vbscript so that I can autologin and
    get my tasks done unattended. As part of my code, I'm trying
    to click to get the vbscript to click the "Login" button but
    I'm always getting that error mentioned below. The unusual
    thing about it is that the login and password fields are
    filled but the line of code where it's supposed to click the
    login button returns an error code rather than logging on
    to the site. Please help.

    Here's the code:

    Set IE = CreateObject("I nternetExplorer .Application")
    IE.Navigate "website"
    IE.Visible = True
    Wscript.Sleep 8000
    IE.Document.All .Item("username ").Value = "loginname"
    IE.Document.All .Item("password ").Value = "password"
    IE.Document.All .Item("Login"). Click

    And here's the error:


    Script: <nameoffile.vbs >
    Line: 7
    Char: 1
    Error: Object Required: 'IE.Document.Al l.Item(..)'
    Code: 800A01A8
    Source: Microsoft VBScript runtime error

  • Steve Gerrard

    #2
    Re: VBscript Web Form Automation


    <dr1jn@umuc.edu > wrote in message
    news:0T8yb.2200 7$yM6.14908@lak eread06...[color=blue]
    >
    > I'm trying to create a vbscript so that I can autologin and
    > get my tasks done unattended. As part of my code, I'm trying
    > to click to get the vbscript to click the "Login" button but
    > I'm always getting that error mentioned below. The unusual
    > thing about it is that the login and password fields are
    > filled but the line of code where it's supposed to click the
    > login button returns an error code rather than logging on
    > to the site. Please help.
    >
    > Here's the code:
    >
    > Set IE = CreateObject("I nternetExplorer .Application")
    > IE.Navigate "website"
    > IE.Visible = True
    > Wscript.Sleep 8000
    > IE.Document.All .Item("username ").Value = "loginname"
    > IE.Document.All .Item("password ").Value = "password"
    > IE.Document.All .Item("Login"). Click
    >
    > And here's the error:
    >
    >
    > Script: <nameoffile.vbs >
    > Line: 7
    > Char: 1
    > Error: Object Required: 'IE.Document.Al l.Item(..)'
    > Code: 800A01A8
    > Source: Microsoft VBScript runtime error
    >[/color]

    Just a guess: the login button is not named "Login". Your seventh line
    of code references a control in the All collection by name:
    All.Item("Login "). If that is not the name of the button object, it
    would return Nothing, and you would get an "Object Required" error when
    you tried to invoke its Click method.



    Comment

    • name

      #3
      Re: VBscript Web Form Automation

      A well written page expects case sensitivity.

      What you get with javascript or jscript.

      Then you decide to use form tag.

      Or not.

      If not. Another document.all whatever takes over.







      <dr1jn@umuc.edu > wrote in message news:0T8yb.2200 7$yM6.14908@lak eread06...[color=blue]
      >
      > I'm trying to create a vbscript so that I can autologin and
      > get my tasks done unattended. As part of my code, I'm trying
      > to click to get the vbscript to click the "Login" button but
      > I'm always getting that error mentioned below. The unusual
      > thing about it is that the login and password fields are
      > filled but the line of code where it's supposed to click the
      > login button returns an error code rather than logging on
      > to the site. Please help.
      >
      > Here's the code:
      >
      > Set IE = CreateObject("I nternetExplorer .Application")
      > IE.Navigate "website"
      > IE.Visible = True
      > Wscript.Sleep 8000
      > IE.Document.All .Item("username ").Value = "loginname"
      > IE.Document.All .Item("password ").Value = "password"
      > IE.Document.All .Item("Login"). Click
      >
      > And here's the error:
      >
      >
      > Script: <nameoffile.vbs >
      > Line: 7
      > Char: 1
      > Error: Object Required: 'IE.Document.Al l.Item(..)'
      > Code: 800A01A8
      > Source: Microsoft VBScript runtime error
      >[/color]

      Comment

      Working...