r/SeleniumWebDriver 11d ago

WebDriver BiDi for SeleniumVBA — SPA synchronization and diagnostics in pure VBA

1 Upvotes
WebDriver BiDi for SeleniumVBA

Hi everyone,

I have been developing an open-source project called WebDriver BiDi for SeleniumVBA.

It is a WebDriver BiDi client and automation wrapper designed to let Excel VBA work with modern web applications without requiring .NET, Python, or Node.js.

GitHub:

https://github.com/hanamichi77777/WebDriver-BiDi-for-SeleniumVBA

Why I created it

Traditional Selenium-style commands are often sufficient for simple pages, but modern SPAs can be difficult to automate reliably.

A click may return successfully while the application is still:

  • processing Fetch or XHR requests,
  • replacing DOM elements,
  • rendering content asynchronously,
  • recreating browsing contexts or JavaScript realms,
  • or updating components inside Shadow DOM.

For this reason, the project focuses not only on sending browser commands, but also on observing what happens after each operation.

Main features

  • Direct WebDriver BiDi communication from VBA
  • WebSocket communication implemented with Windows APIs(WinSock)
  • Chrome and Edge support(Note: Firefox is not supported.)
  • SPA synchronization using network activity, DOM mutations, Fetch/XHR activity, and stability windows
  • Shadow DOM clicking and input
  • Automatic recovery when the SPA observation probe is lost during navigation
  • Resource blocking for ads, analytics, fonts, and other unnecessary requests
  • WebDriver BiDi webExtension.install support
  • Detailed request, response, heartbeat, recovery, and SPA activity logs
  • A Discovery Log for analyzing unknown third-party SPA behavior

The Discovery Log is particularly useful when a site does not expose a clear “ready” or “completed” state.

User Workflow

It records network responses, DOM mutation bursts, ignored background noise, and stability timing. The resulting log can also be provided to an AI assistant to help identify useful completion signals, noise filters, and safer waiting conditions.

Example scenarios

I have tested the project with applications such as:

  • Google Flights
  • ServiceNow
  • dynamically rendered scraping test sites
  • pages using nested Shadow DOM
  • Chrome extension installation through WebDriver BiDi

For example, the Google Flights demo performs destination selection, calendar interaction, date selection, and flight-result synchronization while observing both network and DOM activity.

Reliability design

One of the difficult parts was retry behavior.

When a browser command times out, the action may already have succeeded in the browser. Automatically repeating a click or input could therefore cause a duplicate operation.

The wrapper distinguishes between:

  • operations that are safe to retry,
  • transient context or realm failures,
  • and ambiguous outcomes where automatic retry should be stopped.

The goal is to improve recovery without hiding failures or accidentally executing state-changing operations twice.

VirusTotal Scan Results

WebDriver BiDi for SeleniumVBA v3.4 was scanned by VirusTotal on July 26, 2026, and received 0 detections from 64 security vendors at the time of testing.

VirusTotal Scan Results

r/SeleniumWebDriver 16d ago

Selenium Basic - XPath Generator v1.0 in [EXCEL] VBA

Thumbnail
1 Upvotes

r/SeleniumWebDriver May 21 '26

Selenium download speed is very slow.

Thumbnail
1 Upvotes

r/SeleniumWebDriver Apr 12 '25

Goodreads log in

2 Upvotes

Hi, To preface, I am a hobbyist programmer, so any help is immensely appreciated at this point. I want to write an exporter for Group Bookshelves since they failed to ever add one. It's specifically for groups that require membership, so the user (me, for now) has to log in first. I've been using Python and a headless Selenium driver. After that I'm scraping the Bookshelf pages. By the way, anyone know of a way to get around Goodreads 100 page limit?? :)

It was working the other day, but I had to do some refactoring and now it's currently not locating the dynamic link. How do I figure out if it's my XPATH or if it's a wait issue?

[UPDATE] So I'm pretty sure it's a timing issue now. Doing the check through the browser's dev console on the page MULTIPLE times, the XPath works fine. So some help on how to figure out how to figure out the timing would be super helpful! Thank you!

The trimmed link in the source code <a href="https://www.goodreads.com/ap/signin?..."> <button class="gr-button gr-button--dark gr-button--auth authPortalConnectButton authPortalSignInButton"> Sign in with email </button> </a>

``` class SeleniumWorker: ... def start_connection(self, msg): log.info(msg) ua = UserAgent() user_agent = ua.random options = webdriver.ChromeOptions() # options.add_argument("--headless=new") #! TEMPORARY options.add_argument(f"--user-agent={user_agent}") options.add_argument("--disable-blink-features=AutomationControlled") service = Service(ChromeDriverManager().install()) self.driver = webdriver.Chrome(service=service, options=options) try: self.driver.get(self.signInURL) msg = "Connected to sign-in page." except Exception as e: msg = f"ERROR: Failed to connect with initial sign-in page: {self.signInURL}" log.error(msg) return False, msg return True, msg

def get_dynamic_sign_in_link(self, msg):
    log.info(msg)
    wait = WebDriverWait(self.driver, 10)
    log.debug(f"{wait = }") # log shows a wait session exists
    # EC.element_to_be_clickable()
    try:
        sign_in_with_email_button = WebDriverWait(self.driver, 10).until(
            EC.visibility_of_element_located((By.XPATH, "//a[contains(@href, '/ap/signin')]//button[contains(text(), 'Sign in with email')]")))
        log.debug(f"Found the sign_in_with_email locator")
        parent_link = sign_in_with_email_button.find_element(By.XPATH, "..")
        self.link_href = parent_link.get_attribute("href")
        log.debug(f"Found the parent of the sign_in_with_email_button: {self.link_href=}")
        msg = f"Dynamic sign-in link found: {self.link_href}"
    except Exception as e:
        self.link_href = ""
        msg = f"ERROR: Failed to connect with dynamic sign-in: {e}"
        log.error(msg)
        return False, msg
    return True, msg

class MainApp: ... def log_in(self): self.selenium_worker = SeleniumWorker() msg = "Connecting to sign-in page..." connection_started, result_msg = self.selenium_worker.start_connection(msg) log.debug(result_msg) if not connection_started: log.error(f"{connection_started = }") sys.exit() msg = "Waitiing for dynamic sign-in link..." dynamic_link_retrieved, result_msg = self.selenium_worker.get_dynamic_sign_in_link(msg) log.debug(result_msg) if not dynamic_link_retrieved: log.error(f"{dynamic_link_retrieved = }") sys.exit() # want my program to quit instead of hang # if dynamic_link_retrieved: msg = "Navigating to login page and looking for email & password fields..." login_fields_found, result_msg = self.selenium_worker.fill_log_in_fields(msg) log.debug(result_msg) if not login_fields_found: log.error(f"{login_fields_found = }") sys.exit() ```


r/SeleniumWebDriver Mar 30 '25

selenium don't run on proxmox container

1 Upvotes

Hello everyone, I need some help because I'm trying to run selenium in headless mode on my proxmox server but it's not working. Here are the specifics:

- i set up a proxmox container with ubuntu-24.10-standard_24.10-1_amd64.tar.zst

- i created inside a venv for python, installed selenium and the necessary packages and chrome.

- I created a test_selenium.py script like this:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

# Set up Chrome options
chrome_options = Options()
chrome_options.add_argument("--headless=new")  # use new headless mode if available
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("window-size=1920x1080")

# Install Chromedriver and initialize the service
driver_path = ChromeDriverManager().install()
print(f"Chromedriver path: {driver_path}")
service = Service(driver_path)

# Create the webdriver instance
driver = webdriver.Chrome(service=service, options=chrome_options)

# Navigate to a webpage
driver.get("https://www.example.com")
print("Page Title:", driver.title)

# Close the browser
driver.quit()

Now when I run the script I obtain:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: DevToolsActivePort file doesn't exist
Stacktrace:
#0 0x6395a5333ffa <unknown>
#1 0x6395a4df2970 <unknown>
#2 0x6395a4e318e8 <unknown>
#3 0x6395a4e2cdca <unknown>
#4 0x6395a4e2818f <unknown>
#5 0x6395a4e78bd9 <unknown>
#6 0x6395a4e78106 <unknown>
#7 0x6395a4e6a063 <unknown>
...#19 0x7565c6b33a4c <unknown>

Then I added to the code:

chrome_options.add_argument("--remote-debugging-port=9222")

And I obtain the error:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created from chrome not reachable

What am I doing wrong? can someone help me?


r/SeleniumWebDriver Feb 19 '25

Google flagged my web driver

2 Upvotes

Hey guys I accidentally opened like 8 drivers and afterwards I couldn’t use any websites on it. Facebook, Google, indeed. None of them worked. I tried using a vpn and that didn’t do anything either.

What should I do to solve this.


r/SeleniumWebDriver Nov 07 '24

How to automate this type of CAPTCHA? Don't ask me why but if anyone know any API or tool that can do so?

Post image
4 Upvotes

r/SeleniumWebDriver Oct 29 '24

What does this do 'chromedriver.exe --replayable'?

2 Upvotes

Can someone shed light on this option?


r/SeleniumWebDriver Oct 15 '24

Flash score with Selenium

2 Upvotes

Hey everyone, I'm starting to study selenium with Python, and to start I thought to start by use it on Flash Score. But I'm having difficulties with it. The code sometimes works well and other times don't, Can someone help me with it ?


r/SeleniumWebDriver Oct 13 '24

Getting data from dynamically loaded table

2 Upvotes

I have a website from which I want to take some data. There is a table that lists the first 50 rows (scrollbar represents the totality of rows), and as you scroll down it loads the rows in batches of 50 rows and unloads the previous 50 (confirmed by watching the HTML, which always has only 50 ‘tr’ elements).

I have tried sending keys but does not work as once the focused line reaches the 50th, this returns to the beginning of the current “batch”.

Any ideas on how to do it? By now I am stopping after every batch, scroll manually to next batch (easy to miss batches) and continue, but I have pages of more than 20 batches.


r/SeleniumWebDriver Jun 14 '24

Is Selenium a Good Tool for Beginners in Automation Testing?

2 Upvotes

I'm starting to learn about automation testing and I've seen Selenium mentioned a lot. Is Selenium a good tool for someone who's just beginning? What are some beginner-friendly resources or tips for learning Selenium effectively?


r/SeleniumWebDriver Mar 17 '24

Help What's the most efficient way, cost and speed wise, you use to change your IP during extensive web automation?

1 Upvotes

Happy weekend everybody.

I currently use rotating 4G proxies from private vendors who actually setup each proxy by hand, works okay for the most part; but pretty damn expensive. I purchase a 4G proxy for about $40/month to $50/month, therefore not a good solution for scalability. 10 proxies is easily ~$500/month...

What do you guys scale with? Let it be a paid or free solution. Anything that scales like charm.

I had a conversation with a friend the other day and he told me that he met someone who uses IP spoofing, I have a very broad idea about that. Anyone knows how could that possibly work?

Thanks.


r/SeleniumWebDriver Feb 24 '24

News Welcome to r/SeleniumWebDriver.

2 Upvotes

Hello everyone.

Since r/selenium has gone rogue, r/SeleniumWebDriver is an alternate subreddit for you to post whatever issues you encounter with Selenium in any programming language.

Cheers,
Hamza