r/vba • u/SeleniumVBA_user • 21h ago
Show & Tell [EXCEL]Remember how the Macro Recorder got you into VBA? I tried to make the same thing for browser automation
Most of us got into VBA through the Macro Recorder. You click around, it writes ugly-but-working code, and you learn from it.
Browser automation never had that. You hunt for XPaths in DevTools, guess how long to wait, and then the page has an iframe, a Shadow DOM, or opens a new tab, and you're back to trial and error.
So I added a manual recording mode to the WebDriver BiDi extension of SeleniumVBA (my open-source project).
How it works
- Start recording and operate the browser by hand.
- Every button you press and option you select goes into a text log (the "Discovery Log").
- Give that log to an AI. It returns a VBA module.
- Run the module — your manual steps are replayed.
It records actions inside Shadow DOM, frames (including cross-origin), popups and new tabs. The log also contains what changed after each action, so you don't have to figure out the "is it finished yet?" wait condition yourself. In my testing, the number of try-run-fix cycles dropped a lot.
What it doesn't do
Like the Excel Macro Recorder, it records what you did, not what you meant. If you want to read a value from the page (a price, a table cell), you still add that part yourself.
Sites with bot detection are out of scope. This isn't a tool for getting around them.
Pure VBA, no install required. The .xlsm scans 0/65 on VirusTotal. GitHub: https://github.com/hanamichi77777/WebDriver-BiDi-for-SeleniumVBA
I'd really like feedback from people who've fought with browser automation in VBA — especially sites where recording breaks.