Last active
October 21, 2025 13:34
-
-
Save kinuasa/8efedd752ce787fa506900cc427c3382 to your computer and use it in GitHub Desktop.
SeleniumBasicで指定した要素の背景色を変更するVBAマクロ 関連Tweet:https://twitter.com/kinuasa/status/1440559227026563074
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| Public Sub Sample() | |
| With CreateObject("Selenium.EdgeDriver") | |
| .Get "https://www.ka-net.org/blog/" | |
| Dim elm As Object 'Selenium.WebElement | |
| Set elm = .FindElementByXPath("/html/body/div[1]/div/a/span") | |
| .ExecuteScript "arguments[0].setAttribute('style', 'background-color:cyan')", elm | |
| Stop | |
| End With | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment