1Metadata-Version: 1.1 2Name: selenium 3Version: 3.141.0 4Summary: Python bindings for Selenium 5Home-page: https://github.com/SeleniumHQ/selenium/ 6Author: UNKNOWN 7Author-email: UNKNOWN 8License: Apache 2.0 9Description: ====================== 10 Selenium Client Driver 11 ====================== 12 13 Introduction 14 ============ 15 16 Python language bindings for Selenium WebDriver. 17 18 The `selenium` package is used to automate web browser interaction from Python. 19 20 +-----------+--------------------------------------------------------------------------------------+ 21 | **Home**: | http://www.seleniumhq.org | 22 +-----------+--------------------------------------------------------------------------------------+ 23 | **Docs**: | `selenium package API <https://seleniumhq.github.io/selenium/docs/api/py/api.html>`_ | 24 +-----------+--------------------------------------------------------------------------------------+ 25 | **Dev**: | https://github.com/SeleniumHQ/Selenium | 26 +-----------+--------------------------------------------------------------------------------------+ 27 | **PyPI**: | https://pypi.org/project/selenium/ | 28 +-----------+--------------------------------------------------------------------------------------+ 29 | **IRC**: | **#selenium** channel on freenode | 30 +-----------+--------------------------------------------------------------------------------------+ 31 32 Several browsers/drivers are supported (Firefox, Chrome, Internet Explorer), as well as the Remote protocol. 33 34 Supported Python Versions 35 ========================= 36 37 * Python 2.7, 3.4+ 38 39 Installing 40 ========== 41 42 If you have `pip <https://pip.pypa.io/>`_ on your system, you can simply install or upgrade the Python bindings:: 43 44 pip install -U selenium 45 46 Alternately, you can download the source distribution from `PyPI <https://pypi.org/project/selenium/#files>`_ (e.g. selenium-3.141.0.tar.gz), unarchive it, and run:: 47 48 python setup.py install 49 50 Note: You may want to consider using `virtualenv <http://www.virtualenv.org/>`_ to create isolated Python environments. 51 52 Drivers 53 ======= 54 55 Selenium requires a driver to interface with the chosen browser. Firefox, 56 for example, requires `geckodriver <https://github.com/mozilla/geckodriver/releases>`_, which needs to be installed before the below examples can be run. Make sure it's in your `PATH`, e. g., place it in `/usr/bin` or `/usr/local/bin`. 57 58 Failure to observe this step will give you an error `selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.` 59 60 Other supported browsers will have their own drivers available. Links to some of the more popular browser drivers follow. 61 62 +--------------+-----------------------------------------------------------------------+ 63 | **Chrome**: | https://sites.google.com/a/chromium.org/chromedriver/downloads | 64 +--------------+-----------------------------------------------------------------------+ 65 | **Edge**: | https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ | 66 +--------------+-----------------------------------------------------------------------+ 67 | **Firefox**: | https://github.com/mozilla/geckodriver/releases | 68 +--------------+-----------------------------------------------------------------------+ 69 | **Safari**: | https://webkit.org/blog/6900/webdriver-support-in-safari-10/ | 70 +--------------+-----------------------------------------------------------------------+ 71 72 Example 0: 73 ========== 74 75 * open a new Firefox browser 76 * load the page at the given URL 77 78 .. code-block:: python 79 80 from selenium import webdriver 81 82 browser = webdriver.Firefox() 83 browser.get('http://seleniumhq.org/') 84 85 Example 1: 86 ========== 87 88 * open a new Firefox browser 89 * load the Yahoo homepage 90 * search for "seleniumhq" 91 * close the browser 92 93 .. code-block:: python 94 95 from selenium import webdriver 96 from selenium.webdriver.common.keys import Keys 97 98 browser = webdriver.Firefox() 99 100 browser.get('http://www.yahoo.com') 101 assert 'Yahoo' in browser.title 102 103 elem = browser.find_element_by_name('p') # Find the search box 104 elem.send_keys('seleniumhq' + Keys.RETURN) 105 106 browser.quit() 107 108 Example 2: 109 ========== 110 111 Selenium WebDriver is often used as a basis for testing web applications. Here is a simple example using Python's standard `unittest <http://docs.python.org/3/library/unittest.html>`_ library: 112 113 .. code-block:: python 114 115 import unittest 116 from selenium import webdriver 117 118 class GoogleTestCase(unittest.TestCase): 119 120 def setUp(self): 121 self.browser = webdriver.Firefox() 122 self.addCleanup(self.browser.quit) 123 124 def testPageTitle(self): 125 self.browser.get('http://www.google.com') 126 self.assertIn('Google', self.browser.title) 127 128 if __name__ == '__main__': 129 unittest.main(verbosity=2) 130 131 Selenium Server (optional) 132 ========================== 133 134 For normal WebDriver scripts (non-Remote), the Java server is not needed. 135 136 However, to use Selenium Webdriver Remote or the legacy Selenium API (Selenium-RC), you need to also run the Selenium server. The server requires a Java Runtime Environment (JRE). 137 138 Download the server separately, from: http://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.0.jar 139 140 Run the server from the command line:: 141 142 java -jar selenium-server-standalone-3.141.0.jar 143 144 Then run your Python client scripts. 145 146 Use The Source Luke! 147 ==================== 148 149 View source code online: 150 151 +-----------+-------------------------------------------------------+ 152 | official: | https://github.com/SeleniumHQ/selenium/tree/master/py | 153 +-----------+-------------------------------------------------------+ 154 155Platform: UNKNOWN 156Classifier: Development Status :: 5 - Production/Stable 157Classifier: Intended Audience :: Developers 158Classifier: License :: OSI Approved :: Apache Software License 159Classifier: Operating System :: POSIX 160Classifier: Operating System :: Microsoft :: Windows 161Classifier: Operating System :: MacOS :: MacOS X 162Classifier: Topic :: Software Development :: Testing 163Classifier: Topic :: Software Development :: Libraries 164Classifier: Programming Language :: Python 165Classifier: Programming Language :: Python :: 2.7 166Classifier: Programming Language :: Python :: 3.4 167Classifier: Programming Language :: Python :: 3.5 168Classifier: Programming Language :: Python :: 3.6 169