Registry / testing / pyshadow

pyshadow

JSON →
library0.0.6pypypi✓ verified 87d ago

PyShadow is a Selenium plugin for managing Shadow DOM elements on web pages. It simplifies finding and interacting with elements inside shadow roots. Current version is 0.0.6, updated 3 years ago. Release cadence is low; the library appears to be in maintenance mode.

pip install pyshadow
INSTALL
IMPORT
SIG · PYSHADOW
P
pyshadow
testingpythonv0.0.6
Install
4.2s avg
Import
825ms
Disk
56MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.0.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.864s · 55.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 4.2s · import 0.786s · 56MB
56MB installed
● package 56MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Shadow
✓ from pyshadow.main import Shadow

Initialize Shadow with a Selenium WebDriver instance, then use find_element or find_elements to locate elements inside shadow DOM.

from selenium import webdriver from pyshadow.main import Shadow driver = webdriver.Chrome() driver.get('https://example.com') shadow = Shadow(driver) element = shadow.find_element("selector") print(element.text) driver.quit()
Debug
Known issues
gotchaPyShadow may not work correctly with newer Selenium 4+ because of changes in shadow DOM handling. Some users report that find_element fails when the shadow root is inside another shadow root.
fix
Consider using Selenium's built-in shadow root access: driver.execute_script('return arguments[0].shadowRoot', element).find_element(...)
affects: pyshadow 0.0.6 with selenium >=4
deprecatedThe library has not been updated for 3 years. It may not support modern browser versions or new Selenium releases.
fix
If encountering issues, switch to native Selenium shadow DOM support via WebElement.shadow_root (Selenium 4+).
affects: all
gotchaThe find_element method expects a CSS selector string, but users often pass a non-string or a locator tuple.
fix
Always pass a string CSS selector: shadow.find_element('div.my-class').
affects: all
Errors
Common errors & fixes
AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector'
PyShadow internally uses deprecated Selenium methods like find_element_by_css_selector that were removed in Selenium 4.3+.
fix
Upgrade to a patched version or use Selenium's native shadow DOM support: driver.execute_script('return document.querySelector("...").shadowRoot')
NoSuchElementException: Message: Unable to locate element: {...}
The CSS selector provided does not match an element inside the shadow DOM, often because the shadow root nesting is deeper than expected.
fix
Ensure the selector targets the correct element within the shadow tree. Try using browser DevTools to copy the exact CSS path for the element inside the shadow root.
Upgrade
Version history
0.0.6latest on PyPI · released Jan 3, 2026
Audit
Dependencies
seleniumrequiredPyShadow is a plugin for Selenium WebDriver.
Agent activity
11 hits · last 30 days
node
10
Resources
pyshadow — pip install pyshadow · libregistry