This commit is contained in:
louiscklaw
2025-02-01 01:59:56 +08:00
parent b3da7aaef5
commit 8719fe58b8
310 changed files with 6332 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
Attribute VB_Name = "usage_dom"
Private Sub Get_DOM_1()
Dim driver As New ChromeDriver
driver.Get "https://en.wikipedia.org/wiki/Main_Page"
Dim html As Object
Set html = CreateObject("htmlfile")
html.Open
html.Write driver.PageSource()
html.Close
Debug.Print html.body.innerText
driver.Quit
End Sub
Private Sub Get_DOM_2()
Dim driver As New ChromeDriver
driver.Get "https://en.wikipedia.org/wiki/Main_Page"
Dim html As Object
Set html = CreateObject("htmlfile")
html.body.innerHTML = driver.ExecuteScript("return document.body.innerHTML;")
Debug.Print html.body.innerText
driver.Quit
End Sub