Skip to main content

Query using Jquery on selenium driver.

Project description

BrowserQuery

Use JQuery on selenium drivers.

A simple, yet powerful package to execute Jquery while working on selenium drivers. It also comes built in with some utility methods built in.

Install

pip install browserjquery

Usage

    import time

    from selenium.webdriver import Chrome
    from browserjquery import BrowserJQuery

    driver = Chrome()

    driver.get("https://www.yahoo.com")

    time.sleep(10)

    # create Jquery object
    jquery = BrowserJQuery(driver)

    # execute script
    jquery.execute("""return $("div.stream-item")""")

    # call the object as a method to find/select items
    stream = jquery(".stream-item")

    # call methods/attributes off of the object
    print(jquery.document)

    print(jquery.find(".stream-item a"))

    print(jquery.find_elements_with_text("Hello"))
    print(jquery.find_elements_with_text("Hello", element=stream[0]))

    print(jquery.parent(stream[0]))

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

browserjquery-0.1.0.tar.gz (29.9 kB view hashes)

Uploaded Source

Built Distribution

browserjquery-0.1.0-py3-none-any.whl (30.5 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