{ "info": { "author": "Chris Braun", "author_email": "cryzed@googlemail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "Selenium Requests\r\n=================\r\n\r\nExtends Selenium WebDriver classes to include the\r\n`request `__\r\nfunction from the `Requests `__ library,\r\nwhile doing all the needed cookie and request headers handling.\r\n\r\nBefore the actual request is made, a local HTTP server is started that\r\nserves a single request made by the webdriver instance to get the\r\n\"standard\" HTTP request headers sent by this webdriver; these are cached\r\n(only happens once during its lifetime) and later used in conjunction\r\nwith the Requests library to make the requests look identical to those\r\nthat would have been sent by the webdriver. Cookies held by the\r\nwebdriver instance are added to the request headers and those returned\r\nin a response automatically set for the webdriver instance.\r\n\r\nFeatures\r\n--------\r\n\r\n- Sends the \"default\" HTTP headers for the chosen WebDriver\r\n- Manages cookies bidirectionally: Requests <-> Selenium\r\n- Switches to an already existing window handle, or creates a temporary\r\n new one to work with cookies when making a request\r\n- All operations preserve the original state (active window handle and\r\n window handles) of the WebDriver\r\n- Tested to work with Mozilla Firefox, Google Chrome and PhantomJS\r\n\r\nUsage\r\n-----\r\n\r\n.. code:: python\r\n\r\n # Import any WebDriver class that you would usually import from\r\n # selenium.webdriver from the seleniumrequests module\r\n from seleniumrequests import Firefox\r\n\r\n # Simple usage with built-in WebDrivers:\r\n webdriver = Firefox()\r\n response = webdriver.request('GET', 'https://www.google.com/')\r\n print(response)\r\n\r\n\r\n # More complex usage, using a WebDriver from another Selenium-related module:\r\n from seleniumrequests.request import RequestMixin\r\n from someothermodule import CustomWebDriver\r\n\r\n\r\n class MyCustomWebDriver(CustomWebDriver, RequestMixin):\r\n pass\r\n\r\n\r\n custom_webdriver = MyCustomWebDriver()\r\n response = custom_webdriver.request('GET', 'https://www.google.com/')\r\n print(response)\r\n\r\nInstallation\r\n------------\r\n\r\n``pip install selenium-requests``\r\n\r\nDetails\r\n-------\r\n\r\nThe request method supports two additional arguments:\r\n\r\n- ``find_window_handle_timeout`` (default: -1 seconds)\r\n- ``page_load_timeout`` (default: -1 seconds)\r\n\r\nIf the timeout is negative, then the script will be allowed to run\r\nindefinitely (similarly to Selenium WebDriver's default behaviour).\r\n\r\nThe first is needed because there is no reliable way to create a new\r\nwindow handle with the Selenium WebDriver interface, so a new handle has\r\nto be spawned via JavaScript and subsequently found to be able to get or\r\nset cookies with the WebDriver. There are two methods to do this: The\r\nfirst involves simply comparing the set of window handles before and\r\nafter the JavaScript was executed and finding the difference. If the\r\ndifference is unreliable (0 or more than 1 window handles found) an\r\nalternative less reliable method is used: the top-level domain for each\r\nframe is compared to the top-level domain of the requested URL\r\n(JavaScript redirects are not supported when this method is used). If no\r\nresults are found, an additional GET request is made to the requested\r\ndomain to check for a potential redirect. Whether there was a redirect\r\nor not, the old or new top-level domain will now be searched for\r\n``find_window_handle_timeout`` seconds until it is either found or a\r\n``TimeoutException`` is raised.\r\n\r\nThe second is needed mostly because of\r\n`PhantomJS `__. Every other webdriver blocks\r\nuntil the current window handle is loaded, except PhantomJS. If the new\r\nwindow handle was found via the first method (see above) and then\r\ncookies should be set, it's possible that an exception is raised,\r\nbecause the webdriver has to have switched to a window handle with the\r\ncorrect domain prior to setting cookies. Thus the method waits\r\n``page_load_timeout`` seconds before raising a ``TimeoutException``.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cryzed/Selenium-Requests", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "selenium-requests", "package_url": "https://pypi.org/project/selenium-requests/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/selenium-requests/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/cryzed/Selenium-Requests" }, "release_url": "https://pypi.org/project/selenium-requests/1.3/", "requires_dist": null, "requires_python": null, "summary": "Extends Selenium WebDriver classes to include the request function from the Requests library, while doing all the needed cookie and request headers handling.", "version": "1.3" }, "last_serial": 2027249, "releases": { "1.0.1": [], "1.0.2": [], "1.0.4": [ { "comment_text": "", "digests": { "md5": "3b55c7a389d98edc276bd1cbee2d8854", "sha256": "a8cbfba3b123629678de53d0997dc75ad59a8fbbdd66587e4077a434b0fa406e" }, "downloads": -1, "filename": "selenium-requests-1.0.4.zip", "has_sig": false, "md5_digest": "3b55c7a389d98edc276bd1cbee2d8854", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8826, "upload_time": "2015-04-02T18:36:38", "url": "https://files.pythonhosted.org/packages/69/c1/5baf5ae36308b1e979bbe649ac806cf54eddd94a2a97fd203e1b2b282f3f/selenium-requests-1.0.4.zip" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "556d3db0b7d7bbebe8e51ddb64f38b15", "sha256": "27f55bb8f2f6d5e1dd9b8dac9ef5d3630de7df112a52ea72b4d09adcb5b19093" }, "downloads": -1, "filename": "selenium-requests-1.0.5.zip", "has_sig": false, "md5_digest": "556d3db0b7d7bbebe8e51ddb64f38b15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11075, "upload_time": "2015-04-04T17:01:58", "url": "https://files.pythonhosted.org/packages/f0/65/d748ebc5d88fbfc310bf243ed01cf00b277eebaed33694c5a7aa35902f97/selenium-requests-1.0.5.zip" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "96848b41afec253ea68877347e3844cd", "sha256": "93d23ec171600201d2341778cba09892bc4fd141b499ad83b6864321682c2548" }, "downloads": -1, "filename": "selenium-requests-1.0.6.zip", "has_sig": false, "md5_digest": "96848b41afec253ea68877347e3844cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11189, "upload_time": "2015-04-04T17:15:46", "url": "https://files.pythonhosted.org/packages/78/07/0f8eacb87001dc1fd02079ad38484b6e18809ad142541bca3a1cbcf8f858/selenium-requests-1.0.6.zip" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "362c4565de07b76df593e15e40c0b119", "sha256": "a542f7b3966612674cfca197b1b0fc5676928c8c5a60ca9a367377511219c574" }, "downloads": -1, "filename": "selenium-requests-1.0.7.zip", "has_sig": false, "md5_digest": "362c4565de07b76df593e15e40c0b119", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11472, "upload_time": "2015-04-04T17:49:10", "url": "https://files.pythonhosted.org/packages/1c/b5/5e743bc7a46f525f1001cf6ecc1751fdefcf879fe10035ee5592cd91f77b/selenium-requests-1.0.7.zip" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "d7ee46718b7fc1696d51b97896b05059", "sha256": "a89dd41e2c0a3e20b69d6f5411d497d314f8ff8b7d3befb4c2ead88c6f1e982b" }, "downloads": -1, "filename": "selenium-requests-1.0.8.zip", "has_sig": false, "md5_digest": "d7ee46718b7fc1696d51b97896b05059", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11438, "upload_time": "2015-04-04T18:11:23", "url": "https://files.pythonhosted.org/packages/7f/6e/b8ab1192eb77ab2d7f84bc9ba95708d445f1929d861a1422513d75f7ff14/selenium-requests-1.0.8.zip" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "646afd64667ef8766e48bc64294903a9", "sha256": "98bbd7c2dd80f545993bff0c4bb7985763b7adcd1527179cc23c55f6e6a31cf8" }, "downloads": -1, "filename": "selenium-requests-1.1.0.zip", "has_sig": false, "md5_digest": "646afd64667ef8766e48bc64294903a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9268, "upload_time": "2015-04-04T18:51:31", "url": "https://files.pythonhosted.org/packages/bb/38/52cb19eef9a1de8f2c2726fab077e91e502c06735166cad14fb5b426a7c6/selenium-requests-1.1.0.zip" } ], "1.1.1": [], "1.2.0": [], "1.2.1": [ { "comment_text": "", "digests": { "md5": "a704cdbbb05ad94723b26f40da21fce7", "sha256": "13186caabf27deae86d7bbc95fa949dc5742a4fe6fc4eba217e0835a497753e3" }, "downloads": -1, "filename": "selenium-requests-1.2.1.zip", "has_sig": false, "md5_digest": "a704cdbbb05ad94723b26f40da21fce7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14079, "upload_time": "2015-04-04T23:51:04", "url": "https://files.pythonhosted.org/packages/92/97/5f0a4f537479ec6294fcfda199a13f5f2642ffb7544a6be575499f529118/selenium-requests-1.2.1.zip" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "d94e13316fa622fcd8d3745fe3e2caa5", "sha256": "963fecac4ad99bc115fcd477dd9222fca9afb3497f7965751c93468e5bb34b64" }, "downloads": -1, "filename": "selenium-requests-1.2.4.zip", "has_sig": false, "md5_digest": "d94e13316fa622fcd8d3745fe3e2caa5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14380, "upload_time": "2015-04-05T00:28:06", "url": "https://files.pythonhosted.org/packages/ab/d7/f9ef197735bf4bad4d44f0d01af78a116b38fce2abf818b0013058f0f427/selenium-requests-1.2.4.zip" } ], "1.2.5": [ { "comment_text": "", "digests": { "md5": "c200b329c3eb5ed697d6bbc7475951dd", "sha256": "cbd3ee8a64c01424141db48160fcf346d6711ef5ab9ea41f07e50acdd98f3075" }, "downloads": -1, "filename": "selenium-requests-1.2.5.zip", "has_sig": false, "md5_digest": "c200b329c3eb5ed697d6bbc7475951dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14385, "upload_time": "2015-04-05T01:01:29", "url": "https://files.pythonhosted.org/packages/1a/dd/c6efee6077d5f17a5992b5354a62ea1d3828a0b38bdec03653c9a606994f/selenium-requests-1.2.5.zip" } ], "1.2.6": [ { "comment_text": "", "digests": { "md5": "0cad994700fb343b4f2fc773d60af468", "sha256": "08774990cc39fd6f6ee41d87907ff30374a12ffa38ea6c827fca808374d5e5cc" }, "downloads": -1, "filename": "selenium-requests-1.2.6.zip", "has_sig": false, "md5_digest": "0cad994700fb343b4f2fc773d60af468", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15626, "upload_time": "2015-04-06T19:41:37", "url": "https://files.pythonhosted.org/packages/8e/82/5ad8c00a37120a76a063e8ce02f908f1d496b81cc8324d86e9b0ac753a18/selenium-requests-1.2.6.zip" } ], "1.2.7": [ { "comment_text": "", "digests": { "md5": "1310ad4d07ff672e850869edec5115ea", "sha256": "12563f700f9a8a4f34187040e3d6c7b668bc1ed6198c2defe3f9cea8b307cf36" }, "downloads": -1, "filename": "selenium-requests-1.2.7.zip", "has_sig": false, "md5_digest": "1310ad4d07ff672e850869edec5115ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15432, "upload_time": "2015-04-09T22:36:39", "url": "https://files.pythonhosted.org/packages/23/05/9e80a4b7ae8367b3d2544288dfb7e9b440309ee00e064496687dcc937b95/selenium-requests-1.2.7.zip" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "80bbc51f78e103ec9595f67722292355", "sha256": "85650df2bc1fe9b1f5a2b07571069c1902dd6758fc483e020ff120f0813bb009" }, "downloads": -1, "filename": "selenium-requests-1.3.zip", "has_sig": false, "md5_digest": "80bbc51f78e103ec9595f67722292355", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15756, "upload_time": "2016-03-25T17:55:08", "url": "https://files.pythonhosted.org/packages/78/72/94eadc1667bf4e17e1c5f880fdf8715144b22600114ee68266c8bdde3a09/selenium-requests-1.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "80bbc51f78e103ec9595f67722292355", "sha256": "85650df2bc1fe9b1f5a2b07571069c1902dd6758fc483e020ff120f0813bb009" }, "downloads": -1, "filename": "selenium-requests-1.3.zip", "has_sig": false, "md5_digest": "80bbc51f78e103ec9595f67722292355", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15756, "upload_time": "2016-03-25T17:55:08", "url": "https://files.pythonhosted.org/packages/78/72/94eadc1667bf4e17e1c5f880fdf8715144b22600114ee68266c8bdde3a09/selenium-requests-1.3.zip" } ] }