PKG-INFO 7.5 KB

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