Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
VBscript Web Form Automation
Old
  (#1)
Guest
 
Posts: n/a
Default VBscript Web Form Automation - 06-04-2007, 07:52 AM


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 p***word 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("InternetExplorer.Application")
IE.Navigate "website"
IE.Visible = True
Wscript.Sleep 8000
IE.Document.All.Item("username").Value = "loginname"
IE.Document.All.Item("p***word").Value = "p***word"
IE.Document.All.Item("Login").Click

And here's the error:


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

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: VBscript Web Form Automation
Old
  (#2)
Steve Gerrard
Guest
 
Posts: n/a
Default Re: VBscript Web Form Automation - 06-04-2007, 07:53 AM


<EMAIL REMOVED> wrote in message
news:0T8yb.22007$yM6.14908@lakeread06...
>
> 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 p***word 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("InternetExplorer.Application")
> IE.Navigate "website"
> IE.Visible = True
> Wscript.Sleep 8000
> IE.Document.All.Item("username").Value = "loginname"
> IE.Document.All.Item("p***word").Value = "p***word"
> IE.Document.All.Item("Login").Click
>
> And here's the error:
>
>
> Script: <nameoffile.vbs>
> Line: 7
> Char: 1
> Error: Object Required: 'IE.Document.All.Item(..)'
> Code: 800A01A8
> Source: Microsoft VBScript runtime error
>


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.



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: VBscript Web Form Automation
Old
  (#3)
name
Guest
 
Posts: n/a
Default Re: VBscript Web Form Automation - 06-04-2007, 07:53 AM

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.







<EMAIL REMOVED> wrote in message news:0T8yb.22007$yM6.14908@lakeread06...
>
> 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 p***word 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("InternetExplorer.Application")
> IE.Navigate "website"
> IE.Visible = True
> Wscript.Sleep 8000
> IE.Document.All.Item("username").Value = "loginname"
> IE.Document.All.Item("p***word").Value = "p***word"
> IE.Document.All.Item("Login").Click
>
> And here's the error:
>
>
> Script: <nameoffile.vbs>
> Line: 7
> Char: 1
> Error: Object Required: 'IE.Document.All.Item(..)'
> Code: 800A01A8
> Source: Microsoft VBScript runtime error
>

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Contact Us - Forum Care Forums - Archive - Top