Files
004_comission/armandarmand/task1/task1-ticket1/_ref/VBScript/CustomProfileWith(Chrome).vbs
louiscklaw ce9a4aa9b3 update,
2025-01-31 19:27:58 +08:00

27 lines
1.7 KiB
Plaintext


' ---------------------------------------------------------------------------------------
' Use the WebDriver with a customised version of Chrome.
' Can be used to :
' Keep the same session between runs
' Launch the browser with plug-ins
' Launch the browser with specific preferences
' The profile is automatically created if it's not already present
' ---------------------------------------------------------------------------------------
Class Script
Dim driver
Sub Class_Initialize
Set driver = CreateObject("Selenium.ChromeDriver")
driver.SetProfile "C:\ChromeProfile" 'Full path of the profile directory
driver.Get "https://www.google.com"
WScript.Echo "Click OK to close the browser"
End Sub
Sub Class_Terminate
driver.Quit
End Sub
End Class
Set s = New Script