Skip to main content

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

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.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
glance_dom-0.11.5.tar.gz (11.2 kB) Copy SHA256 hash SHA256 Source None Aug 29, 2017

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