Need Help! VB controlling webpage

Hi all,

Hope anyone can help me with this. Currently stuck and have no idea.
Have a software that are installed on a machine's PC. Software runs on web browser and provides information and also upload data produce from the machine to the server by manual clicking on the browser. This software was created by the machine's vendor so it's cannot be modify.

I am now being given the task to create an auto clicking program using whatever programming language I know. For now, I am only expose to Visual Basic (beginner). Is it possible to write a program that can access the webpage's interface and do what manual action is being done? Action to be done:

1) Read data display on the browser and locate particular details to record down
2) Click on button to go to another page and key in data that was recorded
3) Click on another button to submit
4) Repeat the above

Please help! I would really appreciate it if you could advice me in detail on the codes to work on.
Thanks in advance.
Who is Participating?
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.

You can easily do this with the WebBrowser control. It is not an easy task as you have to extract the html and then parse the html looking for the tags around the text you want.

Clicking a submit button is very easy.

Could you provide the URL and perhaps we can provide code.

magneqAuthor Commented:
Hi Brian,

Thank you for your prompt reply.

Have few question:
1) How do you extract the html?
2) What you meant by parsing the html?

Checked MS site and found few stuff with WebBrowser control. I think what you are telling me is to create a program with a built in WebBrowser control where I can run the webpage in my program right? After that I am lost.

Actually this is a software running on a "testing machine". It's located on an internal network within my company so I don't think I can bring it out.

But it's like a normal webpage with a table on it. The table have few column with data and on one column (which we have to check manually) have data that tells us what is produced during the "machine test". If the data is critical, it will be in hyperlinked and particular image is created. I had to click on it to view the image and then save the image to the server. Then I have to click on the "continue" button to continue the testing.

Previously the test was just normal without much failure but currently it failed quite often that it's troublesome to check, click, view, save and click continue. It will be much faster and efficient if I can do it automatically and just save what is failed.

Hope you can help me out.
Thanks again.



For example to browse to a webpage you could do:


Then in the Navigate_Complete() funciton, you could add:

dim strHtml as string
strHtml = webbrowser1.document.body.innerhtml

dim strTable as string
strTable = right(strHtml, len(strHtml) - instr(strhtml,"<table>"))
strTable = left(strTable,instr(strTable,"</table>"))

and you should have the table in the string StrTable You need to continue around the tags until you have the data its self.

You might also check out the

webbrowser1.document.body.innertext() method.

Good Luck.

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
magneqAuthor Commented:
Think I get what you mean.

Thanks man.

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
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.