Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Good Day,

I am developing a simple program that will automatically fill a website form at one execute of .vbs

My First attempt is to: http://www.tekibears.com/[^]

Sample #1
The code below really works

VB
On Error Resume Next
Const PAGE_LOADED = 4
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("http://www.tekibears.com/contact-us")
objIE.Visible = True

WScript.Sleep(1000) 

objIE.Document.all.Item("w-form-521e10620cf2287d915d4cfd-0").Value = "sampletext@yahoo.com"
objIE.Document.all.Item("w-form-521e10620cf2287d915d4cfd-1").Value = "sampletext@yahoo.com"
objIE.Document.all.Item("w-form-521e10620cf2287d915d4cfd-2").Value = "sampletext@yahoo.com"
objIE.Document.all.Item("w-form-521e10620cf2287d915d4cfd-3").Value = "sampletext@yahoo.com"
objIE.Document.all.Item("w-form-521e10620cf2287d915d4cfd-4").Value = "sampletext@yahoo.com"
objIE.Document.all.Item("w-form-521e10620cf2287d915d4cfd-5").Value = "sampletext@yahoo.com"
objIE.Document.all.Item("w-form-521e10620cf2287d915d4cfd-6").Value = "sampletext@yahoo.com"
objIE.Document.all.Item("w-form-521e10620cf2287d915d4cfd-7").Value = "sampletext@yahoo.com"

objIE.Document.all.Item("contact_form-20684482-DC5A-476A-A102-DE809178C376-submit").submit



Sample #2
My second attempt has a little problem with combo boxes i think, Using IE with default username "toresdodo" and password "ea67f4" already signed in to the account i executed this script

VB
On Error Resume Next
Const PAGE_LOADED = 4
Set objIE = CreateObject("InternetExplorer.Application")
Call objIE.Navigate("http://66.96.90.84/newitem.php")
objIE.Visible = True
Do Until objIE.ReadyState = PAGE_LOADED : Call WScript.Sleep(100) : Loop

objIE.Document.all.Item("sec").selectedvalue = "Want To Buy"
objIE.Document.all.Item("name").Value = "2pcs bullet Camera Package"
objIE.Document.all.Item("cat").selectedindex = "Other PC Devices"
objIE.Document.all.Item("pricebudget").Value = "10880"
objIE.Document.all.Item("con").selectedindex = "Brand New"
objIE.Document.all.Item("warranty").selectedindex = "Shop Warranty"
objIE.Document.all.Item("postspan").selectedindex = "Expire after 15 days"
objIE.Document.all.Item("caption").Value = "Brand new, 1 year warranty, price is 10,880 free delivery. Supports Cloud Technology"




call objIE.Document.all.Item("submit").click
Set objIE = Nothing


In the very beginning i encountered problems Its seems those combo boxes are not responding with my script.

Can someone share an idea.
Posted
Comments
Sni.DelWoods 12-May-14 17:41pm    
Maybe it's the better approach if you use some Firefox plugins to perform a website test.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900