Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Quickly reference DOM elements with minimal inspection.

Project description

Quickly reference DOM elements with minimal inspection.

To learn more about Glance DOM visit the Glance Website.


Installation requires pip:

pip install glance-dom


Instantiate Glance DOM using a browser driver (for example, WebDriver).

from selenium import webdriver
from glance_dom import GlanceDom

def test_glance():
    driver = webdriver.Firefox()

    # Using the old way
    languages = driver.find_element_by_css_selector('h2#other-languages + ul > li')

    # Using Glance
    glance = GlanceDom(driver)
    languages = glance.get_element('Other Languages > li')


You can also get a list of matching elements using get_elements


get_element will raise NoReferenceError if the reference did not match any elements. Similarly it will raise TooBroadReferenceError it there are more than one match.

Project details

Download files

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

Files for glance_dom, version 0.11.5
Filename, size File type Python version Upload date Hashes
Filename, size glance_dom-0.11.5.tar.gz (11.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page