Skip to main content

This can be used along with selenium to identify Shadow Elements present under Shadow DOM/Shadow Root

Project description

Used along with selenium to identify Shadow Elements present under Shadow DOM.

The Structure of shadow DOM would be as below:

Shadow Host -> Shadow Root -> Shadow DOM Elements

check the shadow dom by inspecting the website here:

https://shrinivasbb.github.io/ShadowDomSite

Use this module to get Shadow DOM Elements matching the CSS selectors.

For usage check the below link:

https://github.com/shrinivasbb/shadowselenium

For implementation check the tests folder.

from shadowselenium import ShadowElement

shadowdom = ShadowElement(driver) #argument should be driver instance of opened browser i.e chromedriver etc.

shadowelement = shadowdom.find_shadow_element_by_css("shadow-hostnav", ".nav-link")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shadowselenium-1.0.0.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

shadowselenium-1.0.0-py3-none-any.whl (2.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page