1

How to use VBScript to implement the following:

  • Open web browser

  • Load a URL in web browser after opening

  • List item

  • Click buttons in the loaded browser

Is this possible using VBScript. Any examples of code to help get me started would be beneficial. Also, my web browser is Chrome.

SoftwareCarpenter
  • 3,835
  • 3
  • 25
  • 37
  • 1
    You should include the code you have written so far. – Tomas By Dec 05 '17 at 18:30
  • Can you explain the VBScript requirement further? Perhaps it's not the best technology for the problem you wish to solve? Perhaps something like https://stackoverflow.com/questions/27332339/trigger-a-button-click-inside-an-iframe – Stephen Quan Dec 05 '17 at 20:33
  • Removed unneeded information and or possible advertisement. Cleaned up question to be more general yet specific enough to user's question. – SoftwareCarpenter Dec 07 '17 at 13:21

2 Answers2

1

There is a Selenium webdriver created that works with VB.NET, VBA, and VBScript. Download and install the exe.

There are also lots of example scripts that show loading different browser types or in your case Chrome. Once loaded you just need to program what elements to navigate and click after loading your specific URL.

There might be other ways to launch and run commands against the web browser using VBScript. This is just one way.

SeleniumBasic v2.0.9.0 created by Florent Breheret and open source via git hub.

A Selenium based browser automation framework for VB.Net, Visual Basic Applications and VBScript

Script Example:

Set driver = CreateObject("Selenium.ChromeDriver")
driver.Start
WScript.Echo "Click OK to quit"
driver.Quit

Here is the official SELENIUM page: selenium main page


UPDATE: Here is a second option that is based on the same concept , but implemented a little different. I am not sure it meets your needs , but thought I would include it as another example. VBS WebDriver

Examples using the VBS WebDriver which is intended to provide a simple binding for Selenium 2. The bindings include the full functionality of Selenium 2 (WebDriver).

SoftwareCarpenter
  • 3,835
  • 3
  • 25
  • 37
0

If you press F12 in Internet Explorer you can lie about what browser you are using. Use the compatibility tab (a downward direction play icon) and enter your UA string for a browser they support.

See https://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx

AMagpie
  • 176
  • 1
  • 4