[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

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

Thanks man.


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now