This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
Sulfur is a simplified web driver interface for python-selenium. Sulfur has
a more pleasant (and less java-esque) interface and also uses BeautifulSoup
to make an even tastier API.

Sulfur's main goal is to help writing tests for Web applications. It has
a builtin pytest plugin that defines a few useful fixtures, but it can also be
used with other testing libraries.

You can use Sulfur anywhere that Selenium would be used. Besides the obvious
use case of writing integration tests for web development, Sulfur can be used on
automation, data-mining, presentations, etc.


Basic Usage
===========

Let us start a new webdriver (sulfur uses PhantomJS by default):

>>> from sulfur import Driver
>>> driver = Driver('chrome', home='http://www.python.org') # doctest: +SKIP

.. invisible-code-block:: python
driver = Driver('phantomjs', home='http://www.python.org')

The driver object is used to control the web browser. Now you can send commands,
inspect the page, and interact with the browser in many ways. First say hello :)

>>> driver.script('alert("Hello World!")')

And now goodbye!

>>> driver.close()

Basic actions
=============

Sulfur supports basic navegations actions by the :meth:`sulfur.Driver.back`,
:meth:`sulfur.Driver.forward`, :func:`sulfur.Driver.home`, :meth:`sulfur.Driver.refresh`, and
:meth:`sulfur.Driver.open` methods.

User input can be simulated with the :meth:`sulfur.Driver.click`,
:meth:`sulfur.Driver.send_keys` methods. Sulfur also makes it possible to execute
scripts (:meth:`sulfur.Driver.script`), take screen shots (:meth:`Driver.screenshot`)
and fetch the page HTML source (:meth:`sulfur.Driver.source`).

The full API is covered at :class:`sufur.Driver`.

Selectors and queries
=====================

You can query elements in the current web page using the familiar CSS selector
syntax. The :meth:`driver.Driver.elem` method retrieves a single element and
:meth:`driver.Driver.query` returns a queryset with all matches to that query
selector.

>>> driver.find('p') # fetches all <p>'s in page # doctest: +SKIP
<QuerySet: [...]>

Queries can be nested in a way similar to jQuery.

>>> driver.query('div').find('p').filter('.emph') # doctest: +SKIP
<QuerySet: [...]>

This finds all <divs>'s in page, then selects their <p>'s children and then
filters the result to paragraphs with the "emph" class.



selector.

>>> driver.find('p') # fetches all <p>'s in page # doctest: +SKIP
<QuerySet: [...]>

Queries can be nested in a way similar to jQuery.

>>> driver.query('div').find('p').filter('.emph') # doctest: +SKIP
<QuerySet: [...]>

This finds all <divs>'s in page, then selects their <p>'s children and then
filters the result to paragraphs with the "emph" class.



selector.

>>> driver.query('p') # fetches all <p>'s in page # doctest: +SKIP
<QuerySet: [...]>

Queries can be nested in a way similar to jQuery.

>>> driver.find('div').find('p').filter('.emph') # doctest: +SKIP
<QuerySet: [...]>

This finds all <divs>'s in page, then selects their <p>'s children and then
filters the result to paragraphs with the "emph" class.



selector.

>>> driver.query('p') # fetches all <p>'s in page # doctest: +SKIP
<QuerySet: [...]>

Queries can be nested in a way similar to jQuery.

>>> driver.find('div').find('p').filter('.emph') # doctest: +SKIP
<QuerySet: [...]>

This finds all <divs>'s in page, then selects their <p>'s children and then
filters the result to paragraphs with the "emph" class.



selector.

>>> driver.query('p') # fetches all <p>'s in page # doctest: +SKIP
<QuerySet: [...]>

Queries can be nested in a way similar to jQuery.

>>> driver.query('div').find('p').filter('.emph') # doctest: +SKIP
<QuerySet: [...]>

This finds all <divs>'s in page, then selects their <p>'s children and then
filters the result to paragraphs with the "emph" class.


What's up with this name?
=========================

Sulfur is the element that sits just on top of Selenium in the periodic table.
Elements within the same column share many chemical and electronic properties,
but since Sulfur has an atomic number of only 16 (vs. 34 for Selenium), it is
considerably lighter ;)
Release History

Release History

0.1.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
sulfur-0.1.4.tar.gz (27.9 kB) Copy SHA256 Checksum SHA256 Source Mar 24, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting