Skip to content

Commit

Permalink
docs: Cleanup docs with modern python examples (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfehler authored Jun 21, 2024
1 parent 68b96cd commit 931da93
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 144 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
splinter
++++++++

Splinter is a Python framework that provides a simple and consistent interface for web application automation.
Splinter is a simple and consistent API for web application automation.

.. |pypi| image:: https://img.shields.io/pypi/v/splinter.svg
:target: https://pypi.org/project/splinter
Expand Down
81 changes: 0 additions & 81 deletions docs/_static/splinter-docs.css

This file was deleted.

6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
:caption: Overview
:hidden:

why
changelog
tutorial
overview/why
overview/changelog
overview/tutorial

.. toctree::
:caption: Installation Guide
Expand Down
77 changes: 34 additions & 43 deletions docs/install/driver_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,65 @@
:description: How to use splinter with Chrome WebDriver
:keywords: splinter, python, tutorial, how to install, installation, chrome, selenium

+++++++
Drivers
+++++++
+++++++++++++++
Install Drivers
+++++++++++++++
.. _install-drivers:

The various Drivers which are supported by splinter must be installed separately.

Selenium-based Drivers
======================
Install Using Extra Arguments
=============================

To use ``chrome``, ``fireFox``, ``edge``, or ``remote``, the python bindings for Selenium must be installed.
When splinter is installed via pip, extra arguments can be provided.
These will automatically install the latest version of the desired driver.

When splinter is installed via pip, the `selenium` extra argument can be provided.
This will automatically install the latest version of Selenium.
The following are the valid extra arguments

- selenium
- django
- flask
- zope.testbrowser

Example
-------

To install splinter with selenium included automatically:

.. code-block:: bash
python -m pip install splinter[selenium]
pip install splinter[selenium]
Selenium
========

To use ``chrome``, ``fireFox``, ``edge``, or ``remote``, the
`python bindings for Selenium <https://pypi.org/project/selenium/>`_ must be installed.

Django
======

To use the ``django``, the following must be installed:

`django <http://pypi.python.org/pypi/django>`_,
`lxml <https://pypi.python.org/pypi/lxml>`_,
`cssselect <http://pypi.python.org/pypi/cssselect>`_.

When splinter is installed via pip, the `django` extra argument can be provided.
This will automatically install Django.

.. code-block:: bash
python -m pip install splinter[django]
- `django <http://pypi.python.org/pypi/django>`_
- `lxml <https://pypi.python.org/pypi/lxml>`_
- `cssselect <http://pypi.python.org/pypi/cssselect>`_

Flask
=====


To use the ``flask`` driver, the following must be installed:

`Flask <https://pypi.python.org/pypi/Flask>`_,
`lxml <https://pypi.python.org/pypi/lxml>`_,
`cssselect <http://pypi.python.org/pypi/cssselect>`_.

When splinter is installed via pip, the `flask` extra argument can be provided.
This will automatically install Flask.

.. code-block:: bash
python -m pip install splinter[flask]
- `Flask <https://pypi.python.org/pypi/Flask>`_
- `lxml <https://pypi.python.org/pypi/lxml>`_
- `cssselect <http://pypi.python.org/pypi/cssselect>`_

zope.testbrowser
================


To use the ``zope.testbrowser``, the following must be installed:

`zope.testbrowser <http://pypi.python.org/pypi/zope.testbrowser>`_,
`lxml <https://pypi.python.org/pypi/lxml>`_,
`cssselect <http://pypi.python.org/pypi/cssselect>`_.

When splinter is installed via pip, the `zope.testbrowser` extra argument can be provided.
This will automatically install Flask.

.. code-block:: bash
python -m pip install splinter[zope.testbrowser]
- `zope.testbrowser <http://pypi.python.org/pypi/zope.testbrowser>`_
- `lxml <https://pypi.python.org/pypi/lxml>`_
- `cssselect <http://pypi.python.org/pypi/cssselect>`_
12 changes: 6 additions & 6 deletions docs/install/external.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Chrome

The following applications are required:

- `Google Chrome <http://google.com/chrome>`_
- `ChromeDriver <https://chromedriver.chromium.org/>`_
- `Google Chrome <http://google.com/chrome>`_
- `ChromeDriver <https://chromedriver.chromium.org/>`_

Chromedriver must also be available on your operating system's `PATH` environment variable.

Expand Down Expand Up @@ -70,8 +70,8 @@ Firefox

The following applications are required:

- `Mozilla Firefox <http://firefox.com>`_
- `Geckodriver <https://github.com/mozilla/geckodriver/releases>`_
- `Mozilla Firefox <http://firefox.com>`_
- `Geckodriver <https://github.com/mozilla/geckodriver/releases>`_

Geckodriver must also be available on your operating system's `PATH` environment variable.

Expand All @@ -95,8 +95,8 @@ Edge

The following applications are required:

- `Microsoft Edge <https://www.microsoft.com/edge>`_
- `Microsoft Edge Driver <https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/>`_
- `Microsoft Edge <https://www.microsoft.com/edge>`_
- `Microsoft Edge Driver <https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/>`_

Microsoft Edge Driver must also be available on your operating system's `PATH` environment variable.

Expand Down
12 changes: 6 additions & 6 deletions docs/install/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ Basic Requirements

Splinter officially supports Python versions 3.8 and up.

Latest version via pip
======================
pip
===

To install the latest release, run the following command in the terminal:

.. code-block:: bash
python -m pip install splinter
pip install splinter
Install With Driver Dependencies
--------------------------------

pip can be given extra arguments to automatically install driver dependencies.

The `Install Drivers` section of the documentation has more information for each driver.
The :ref:`Install Drivers <install-drivers>` section of the documentation has more information for each driver.

.. highlight:: bash

::

$ python -m pip install splinter[django]
$ pip install splinter[selenium]


From Source Code
Expand All @@ -59,4 +59,4 @@ Once you have a copy of the source code, you can manually install the package:
::

$ cd splinter
$ python setup.py install
$ pip install .
2 changes: 1 addition & 1 deletion docs/changelog.rst → docs/overview/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
Changelog
+++++++++

.. include:: ../CHANGELOG.rst
.. include:: ../../CHANGELOG.rst
2 changes: 1 addition & 1 deletion docs/tutorial.rst → docs/overview/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Tutorial
++++++++

Before starting, make sure Splinter is :doc:`installed <install/install>`
Before starting, make sure Splinter is :doc:`installed <../install/install>`

This tutorial provides a simple example, teaching step by step how to:

Expand Down
3 changes: 1 addition & 2 deletions docs/why.rst → docs/overview/why.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
Why Use Splinter?
+++++++++++++++++


Splinter is used to write web browser automation scripts.
Splinter is a Python library used to write web browser automation scripts.

The project has two primary goals:

Expand Down

0 comments on commit 931da93

Please sign in to comment.