INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Newbie help - Navigate to a varible url bassed on a list/database

Newbie help - Navigate to a varible url bassed on a list/database

Newbie help - Navigate to a varible url bassed on a list/database

(OP)
Hey tek-tipper's
I'm rather unskilled when it comes to writing vbs scripts, however a few months back I decided I would look into automating a few web forms and with some help from the community I was able to successfully automate a few of my daily tasks.

I now have another idea that would significantly decrease my current work load.

Due to an influx of unforseen data, I now have an overload of webpforms that need to be completed.

What's required:
VBS script that opens IE and navigates to a variable URL

If a pop up appears,(only appears on some of the url's) script clicks ok.

Waits for webpage to load - Note the URL loads quickly however the JavaScript webpage is a lot slower.

make a selection from a drop box

make another selection from a drop box

click submit.


Rather simple, but here is where I'm lost.
Once the form is completed it needs to go the 'next URL' and perform the same task.

Now as I mentioned at the start of this post the URL varies for each form. However its only that last part of the URL that varies. See the below example the URL remains the same only the id changes
http://URL/GEM/wwwsci/cms_call_outcome_sts_frame.h...

I have a list with hundreds of id's that all need to be updated.

As mentioned earlier I have pre populated forms in the past but nothing that needs to reference to a list.

here's all I know..

Dim URL

Dim IE

Dim ID

Set objIE = CreateObject("InternetExplorer.Application")

Call objIE.Navigate("http://URL/GEM/wwwsci/cms_call_outcome_sts_frame.h...") '<-- Don't know how insert id referenced from a list

objIE.Visible = True

Do Until objIE.ReadyState = PAGE_LOADED : Call WScript.Sleep(100) : Loop '<-- load url
WScript.Sleep(2500) '<-- Wait for webpage JavaScript (can take 20 seconds)

IE.Document.getElementByName("oper_select10").value = "1" 'select first drop down box (not working)

IE.Document.getElementByName("oper_select6").value = "1" 'select second drop down box (not working)

IE.Document.getElementByName("I2").Click 'Submit form (not working)

WScript.Sleep(2500)

Then the script needs to loop but with a different id..

I'm also curious why even the basic's of selecting my drop down box don't work any help or idea's is greatly appreciated.

Thank you in advance!



RE: Newbie help - Navigate to a varible url bassed on a list/database

If you have a list of the IDs, you can use For Each...Next to loop through the list and concatenate the ID to the URL:

Dim IDList As New List(Of String)

Dim ThisURL As String = "http://url/GEM/wwwsci/cms_call_outcome_sts_frame.h...=" 'note there's no ID

'code here to fill the list. Let me know if you need help with this

Dim URL

Dim IE

Set objIE = CreateObject("InternetExplorer.Application")

For Each sID As String In IDList

Call objIE.Navigate("http://url/GEM/wwwsci/cms_call_outcome_sts_frame.h...=" & sID) 'concatenate the current ID to the URL

objIE.Visible = True

Do Until objIE.ReadyState = PAGE_LOADED : Call WScript.Sleep(100) : Loop '<-- load url
WScript.Sleep(2500) '<-- Wait for webpage JavaScript (can take 20 seconds)

IE.Document.getElementByName("oper_select10").value = "1" 'select first drop down box (not working)
IE.Document.getElementByName("oper_select6").value = "1" 'select second drop down box (not working)

IE.Document.getElementByName("I2").Click 'Submit form (not working)

WScript.Sleep(2500)
Next

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close