How to use vbscript to click on a button?

I have a vbscript that navigates to a website, but I need to click on a button with the below code.
<span class="urTxtStd">Time Entry</span>

Open in new window

kbay808Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ankit PareekOnline MarketingCommented:
try the following code
Dim objWshShell,IE,searchStr

Set objWshShell = Wscript.CreateObject("Wscript.Shell")
Set IE = CreateObject("InternetExplorer.Application")
searchStr = InputBox("Search")

With IE
  .Visible = True
  .Navigate "http://www.google.com"

'Wait for Browser
  Do While .Busy
    WScript.Sleep 100
  Loop
  .Document.getElementsByName("q").Item(0).Value = searchStr
  .Document.getElementsByName("btnK").Item(0).Click
End With

Open in new window

kbay808Author Commented:
I found that code online, but I could not get it to work.  I tried the following:
.Document.getElementsByClassName("urTxtStd").Item(0).click

Open in new window

and
.Document.getElementsByClassName("Time Entry").Item(0).click

Open in new window

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Can you show some more code around what you posted already? There is no button in that chunk, so we cannot help.
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

kbay808Author Commented:
Here is the a copy of the source code.  I added a space before and after the target line to make it easier to find.
Source-Code.txt
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Looks like this should work:
.Document.getElementById("time_entry").click()

Open in new window

kbay808Author Commented:
No joy, I'm getting the following error: "Invalid or unqualified reference" Code: 800A01F9
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
I have tested that as far as possible with the file provided and PowerShell, so you are on your own now. In VBScript debugging is difficult. Are you able to use Excel, Word or Outlook VBA instead? Because those come with a debugger ...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.