VB script to login web page

July 27, 2010 at 05:44:46
Specs: Windows XP

Hi,

I am trying to create a VB script to automatically complete the username and password fields and click the submit button on my webpage...i am getting an error with the 2nd to last line....

this is what i have thus far:

Option Explicit

With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "http://mywebsite.com"

Do While .Busy
WScript.sleep 100
Loop

.Document.getElementsByName("j_username").Item(0).Value = "user1"
.Document.getElementsByName("j_password").Item(0).Value = "pasSWord1"


.Document.getElementsByID("j_security_check").Click()

End With


See More: VB script to login web page

Report •


#1
July 28, 2010 at 06:01:13

Can anyone help !!!

Report •

#2
July 28, 2010 at 13:05:21

Without an error message? No.

Report •

#3
August 10, 2010 at 13:56:10

If you comment out your Option Explicit line, it should show you an error message. If that isn't enough, post the error message here and we'll try to help you out.

Report •

Related Solutions

#4
August 15, 2010 at 11:48:45


As a possible alternative, you can also login using biterscripting.




# Script Login.txt
isstart "a" "login" "Mozilla/4.0"
isconnect "a" "http://mywebsite.com"
isget "a" "login_form.php"
ispost "a" "login=abc" "password=xyz"
isdiscon "a"
isend "a"



This is just a sample script showing the sequence of commands you need to execute. If you had posted an exact website and the page, I would have been able to be more specific.



Report •


Ask Question