-
Feb 27th, 2024, 03:56 PM
#1
Thread Starter
Junior Member
VB6 and Selenium --> SeleniumBasic ?
It seems the selenium can be used with VBA.
So, can Selenium be used with VB6 ?
https://florentbr.github.io/SeleniumBasic/
-
Feb 28th, 2024, 03:17 AM
#2
Lively Member
Re: VB6 and Selenium --> SeleniumBasic ?
Yes, you can use it from VB6, I have some projects that work with it. If you want some sample code just let me know. I use also Google Chrome so you need the wrapper and the Chromedriver for your Chrome version (https://googlechromelabs.github.io/chrome-for-testing/)
-
Feb 28th, 2024, 09:51 AM
#3
Thread Starter
Junior Member
Re: VB6 and Selenium --> SeleniumBasic ?
 Originally Posted by zx81sp
Yes, please ! can you post it here ?
I installed SeleniumBasic Yesterday, but for me a simple task to open a webpage resulted in a error, something as Class not registered !
Last edited by AngeloGomes; Feb 28th, 2024 at 01:16 PM.
-
Mar 1st, 2024, 09:42 AM
#4
Lively Member
Re: VB6 and Selenium --> SeleniumBasic ?
First of all you need to install Selenium wrapper and the chrome driver I've posted (choose the right version for your Chrome).
You must add to your project the references for "Selenium Type Library" (under Project->References)
And try a code like this:
Code:
Dim Chrome As new WebDriver
Dim By As new Selenium.By
Chrome.Get "https://www.yourpage.com"
'for example you can look for a button css
If Chrome.IsElementPresent(By.Css("button.btn.btn-secondary")) Then
'do something
End If
...
-
Mar 1st, 2024, 12:07 PM
#5
Thread Starter
Junior Member
Re: VB6 and Selenium --> SeleniumBasic ?
 Originally Posted by zx81sp
First of all you need to install Selenium wrapper and the chrome driver I've posted (choose the right version for your Chrome).
...[/CODE]
The Chromedriver is ok, but the Selenium Wrapper: which one do you use ?
-
Mar 1st, 2024, 05:10 PM
#6
Lively Member
Re: VB6 and Selenium --> SeleniumBasic ?
 Originally Posted by AngeloGomes
The Chromedriver is ok, but the Selenium Wrapper: which one do you use ?
The wrapper is the one you posted in your first post.
-
Mar 7th, 2024, 12:53 PM
#7
Thread Starter
Junior Member
Re: VB6 and Selenium --> SeleniumBasic ?
Hi zx81sp
Thank you.
I could run the code now.
I´ve also found an updated version for the wrapper see
SeleniumBasic 3.141.0.0
https://www.cnblogs.com/ryueifu-VBA/p/13661128.html
Now I am facing some problems to trap errors. If Selenium gets an error, the vb code stops to run and display a message by default, The line "On Error Goto" does not work for this
Last edited by AngeloGomes; Mar 7th, 2024 at 02:31 PM.
-
Mar 8th, 2024, 03:55 PM
#8
Re: VB6 and Selenium --> SeleniumBasic ?
 Originally Posted by AngeloGomes
it,'s SeleniumBasic2.0Open source has the source code.But after I recompile, it will also cause frequent crashes and can not be registered for use.
how to use it without register dll,setup?
Selenium Basic 3.141, which has a lot of compatibility issues and often fails to install and use.
-
Mar 8th, 2024, 03:58 PM
#9
Re: VB6 and Selenium --> SeleniumBasic ?
The perfect way is to use a web socket connection yourself. The chrome debugging protocol, which does not require any SeleniumBasic wrappers, is the fastest and most stable,
-
Mar 9th, 2024, 03:23 PM
#10
Lively Member
Re: VB6 and Selenium --> SeleniumBasic ?
 Originally Posted by AngeloGomes
Hi zx81sp
Thank you.
I could run the code now.
I´ve also found an updated version for the wrapper see
SeleniumBasic 3.141.0.0
https://www.cnblogs.com/ryueifu-VBA/p/13661128.html
Now I am facing some problems to trap errors. If Selenium gets an error, the vb code stops to run and display a message by default, The line "On Error Goto" does not work for this

I use the older wrapper and since it works fine I never tried to find an updated one.
I don't have errors with the wrapper but will take a look forcing one and will see if it can be controlled.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|