Skip to main content

Quickly reference DOM elements with minimal inspection.

To learn more about Glance DOM visit the Glance Website.

Installation

Installation requires pip:

pip install glance-dom

Usage

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()
    driver.get('http://quasimatic.org/glance')

    # 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')

    print(languages.text)

You can also get a list of matching elements using get_elements

Exceptions

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.

Release files for glance_dom 0.11.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glance_dom 0.11.5
File Size Uploaded
glance_dom-0.11.5.tar.gz 11.2 kB Details

Release files / glance_dom-0.11.5.tar.gz

Download URL glance_dom-0.11.5.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5bb2d7775ae473e59808be2cd6e6a94597b36e002696ee46084cd72f95d17440
BLAKE2b-256 checksum
How to use checksums
11f235c28906e53a138547f6820a9b36b300e545d194f32b14a4a346c3153e28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.11.5 This release

1 release file

0.11.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page