This commit is contained in:
louiscklaw
2025-01-31 19:27:58 +08:00
parent 9476a736d3
commit ce9a4aa9b3
313 changed files with 6340 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
Attribute VB_Name = "Config"
Option Explicit
Global ChromiumBinaryPath as string
Sub init
ChromiumBinaryPath = "C:\Users\logic\AppData\Local\Chromium\Application\chrome.exe"
end sub

View File

@@ -0,0 +1,41 @@
Attribute VB_Name = "Helloworld"
Option Explicit
Dim driver As New ChromeDriver
Dim rowc, cc, columnC As Integer
Sub helloworld()
On Error GoTo eh
Config.init
driver.SetBinary ChromiumBinaryPath
driver.Start
driver.AddArgument "--disable-blink-features=AutomationControlled"
' driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})")
' driver.ExecuteScript "alert('helloworld')"
' driver.ExecuteScript "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"
' driver.Get "http://localhost:8080/navigator_webdriver_test.html"
' https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html
' driver.Get "https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html"
driver.Get "http://www.aastocks.com"
Application.Wait Now + TimeValue("00:00:5")
Done:
debug.print "hello done"
driver.quit
exit sub
eh:
debug.print "hello error"
End Sub

View File

@@ -0,0 +1,5 @@
@REM start excel by yourself
@REM ./test.xlsm
xlwings vba edit

View File

@@ -0,0 +1,13 @@
{
"name": "hello-error",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"gitUpdate":"git add . && git commit -m\"update,\""
},
"keywords": [],
"author": "",
"license": "ISC"
}