{"id":17101279,"url":"https://github.com/keitaoouchi/seleniumwrapper","last_synced_at":"2026-06-05T10:30:15.185Z","repository":{"id":3242972,"uuid":"4279893","full_name":"keitaoouchi/seleniumwrapper","owner":"keitaoouchi","description":"selenium webdriver wrapper to make manipulation easier.","archived":false,"fork":false,"pushed_at":"2016-03-14T09:10:50.000Z","size":104,"stargazers_count":36,"open_issues_count":0,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-05T08:52:27.976Z","etag":null,"topics":["selenium"],"latest_commit_sha":null,"homepage":"http://pypi.python.org/pypi/seleniumwrapper","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keitaoouchi.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-10T03:29:46.000Z","updated_at":"2024-02-23T22:36:41.000Z","dependencies_parsed_at":"2022-08-27T03:24:31.861Z","dependency_job_id":null,"html_url":"https://github.com/keitaoouchi/seleniumwrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keitaoouchi%2Fseleniumwrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keitaoouchi%2Fseleniumwrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keitaoouchi%2Fseleniumwrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keitaoouchi%2Fseleniumwrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keitaoouchi","download_url":"https://codeload.github.com/keitaoouchi/seleniumwrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239859567,"owners_count":19708865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["selenium"],"created_at":"2024-10-14T15:24:38.331Z","updated_at":"2026-06-05T10:30:14.981Z","avatar_url":"https://github.com/keitaoouchi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"About this module\n-----------------\nselenium webdriver wrapper to make manipulation easier.\n\n.. image:: https://secure.travis-ci.org/keitaoouchi/seleniumwrapper.png\n.. image:: https://img.shields.io/pypi/dm/seleniumwrapper.svg\n    :target: https://pypi.python.org/pypi//seleniumwrapper/\n    :alt: Downloads\n.. image:: https://img.shields.io/pypi/v/seleniumwrapper.svg\n    :target: https://pypi.python.org/pypi/seleniumwrapper/\n    :alt: Latest Version\n.. image:: https://img.shields.io/pypi/pyversions/seleniumwrapper.svg\n    :target: https://pypi.python.org/pypi/seleniumwrapper/\n    :alt: Supported Python versions\n.. image:: https://img.shields.io/pypi/l/seleniumwrapper.svg\n    :target: https://pypi.python.org/pypi/seleniumwrapper/\n    :alt: License\n\nFeatures\n--------\n\n* Support Internet Explorer, Chrome, Opera, Firefox, PhantomJS\n* Support remote webdriver.\n* Easy to type aliases. (find_element_by_xpath =\u003e xpath, etc.)\n* Wrapped WebdriverWait( ... ).until( ... ) pattern.\n* Polling at the time of clicking or selecting.\n* Wrapping chaining.\n\nHow to install\n--------------\nRequires python2.6 or later.\nYou need *pip* or *distribute* or *setuptools*::\n\n    $ pip install seleniumwrapper\n\nor use easy_install::\n\n    $ easy_install seleniumwrapper\n\nalso you need selenium::\n\n    $ pip install selenium\n\nExample to use\n--------------\n\n**create** function helps you to init webdriver and wrap it easily::\n\n    \u003e\u003e\u003e import seleniumwrapper as selwrap\n    \u003e\u003e\u003e br = selwrap.create(\"chrome\")\n\n**connect** function helps you to use remote webdriver and wrap it::\n\n    \u003e\u003e\u003e br = connect(\"android\", \"http://localhost:9999\", {\"acceptSslCerts\": True})\n\nSeleniumWrapper delegate to its wrapped webdriver::\n\n    \u003e\u003e\u003e br.get(\"http://www.example.com\")\n    \u003cseleniumwrapper.wrapper.SeleniumWrapper object at 0x...\u003e\n    \u003e\u003e\u003e br.xpath(\"//div[@class='main'])\n    \u003cseleniumwrapper.wrapper.SeleniumWrapper object at 0x...\u003e\n\nSetting **eager=True** to invoke find_elements::\n\n    \u003e\u003e\u003e br.xpath(\"//a\", eager=True)\n    \u003cseleniumwrapper.wrapper.SeleniumContainerWrapper object at 0x...\u003e\n\nSeleniumContainerWrapper also delegate to its wrapped container::\n\n    \u003e\u003e\u003e links = [i.get_attribute(\"href\") for i in br.xpath(\"//a\", eager=True)]\n\nEach contents in SeleniumContainerWrapper also SeleniumWrapper::\n\n    \u003e\u003e\u003e tds = [tr.xpath(\"//td\", eager=True) for tr in br.xpath(\"//tr\", eager=True)]\n\nBasic API\n---------\n* seleniumwrapper.create(drivername)\n* seleniumwrapper.connect(drivername, executor, custom_capabilities)\n    Create webdriver instance and wrap it with SeleniumWrapper.\n\nSeleniumWrapper\n^^^^^^^^^^^^^^^\n* unwrap\n    Retrieves WebDriver or WebElement from wrapped object::\n\n        \u003e\u003e\u003e isinstance(br.unwrap, WebElement)\n        True\n\n* parent\n    find_element_by_xpath(\"./parent::node()\")::\n\n        \u003e\u003e\u003e price = br.by_tag(\"th\", \"Price\").parent.by_tag(\"td\").text\n\n* performance\n    Returns window.performance wrapped object::\n\n        \u003e\u003e\u003e performance = br.performance\n        \u003e\u003e\u003e timing = performance.timing\n        \u003e\u003e\u003e navigation = performance.navigation\n        \u003e\u003e\u003e timing.loadEventEnd\n        1358319427476\n\n* to_select\n    Convert wrapped WebElement to raw Select object::\n\n        \u003e\u003e\u003e br.by_id('select_button').to_select.select_by_visible_text(\"hoge\")\n\n    select method returns the same as below::\n\n        \u003e\u003e\u003e br.select(id = 'select_button').select_by_visible_text(\"hoge\")\n\n* alert\n    Returns Alert(switch_to_alert()) object::\n\n        \u003e\u003e\u003e br.alert.accept()\n\n* current_url\n    Returns current_url after loading page body::\n\n        \u003e\u003e\u003e br.current_url\n\n* timeout\n    Accessor for _timeout property::\n\n        \u003e\u003e\u003e br.timeout\n        5\n        \u003e\u003e\u003e br.timeout = 10\n        \u003e\u003e\u003e br.timeout\n        10\n\n* silent\n    Accessor for _silent property::\n\n        # default\n        \u003e\u003e\u003e br.by_id(\"Hoge\")\n        Traceback (most recent call last):\n            ...\n        NoSuchElementException:...\n        \u003e\u003e\u003e br.silent = True\n        \u003e\u003e\u003e br.by_id(\"Hoge\") is None\n        True\n\n* attr(name)\n    Shortcut to get_attribute::\n\n        \u003e\u003e\u003e br.attr('href')\n\n* click(timeout=3, presleep=0, postsleep=0)\n    Continue to polling until timeout or element is displayed and clickable::\n\n        \u003e\u003e\u003e br.button(\"Send\").click()\n\n* scroll_to(x, y)\n    equivalent to javascript's scrollTo::\n\n        \u003e\u003e\u003e br.scrollTo(0, 100)\n\n* scroll_by(x, y)\n    equivalent to javascript's scrollBy::\n\n        \u003e\u003e\u003e br.scrollBy(10, 10)\n\n* scroll_into_view(jq_identifier, align_with_top=True)\n    find elements by jq_identifier and retrieve its first element and invoke scrollIntoView to it::\n\n        \u003e\u003e\u003e var element = $('#hoge');\n        \u003e\u003e\u003e element \u0026\u0026 element.scrollIntoView(true)\n\n    second argument is passed as javascript's boolean to scrollIntoView::\n\n        \u003e\u003e\u003e br.scrollIntoView('#hoge', False)\n\n* waitfor(type, target, eager=False, timeout=3)\n    See source::\n\n        \u003e\u003e\u003e br.waitfor(\"xpath\", \"//input[@type='submit']\")\n\n* xpath(target, eager=False, timeout=3)\n    find_element_by_xpath(target, timeout)::\n\n        \u003e\u003e\u003e buttons = br.xpath(\"//input[@type='submit' or @type='button']\", eager=True)\n\n* css(target, eager=False, timeout=3)\n    find_element_by_css_selector(target, timeout)::\n\n        \u003e\u003e\u003e [li.text for li in br.css(\"ul li\")]\n\n* by_tag(self, tag, eager=False, timeout=3, \\*\\*attributes)\n    Returns specified tagged element with specified attributes optionally.::\n\n        \u003e\u003e\u003e br.by_tag(\"link\", rel=\"stylesheet\")\n\n* by_text(text, tag='*', partial=False, eager=False, timeout=3)\n    similar to find_element_by_link_text or find_element_by_partial_link_text, but this method can be applicable to any tag::\n\n        \u003e\u003e\u003e br.by_text(\"Go back to Top Page\", \"a\")\n\n* by_class(target, eager=False, timeout=3)\n    find_element_by_class_name(target, timeout)::\n\n        \u003e\u003e\u003e br.by_class(\"colored\")\n\n* by_id(target, eager=False, timeout=3)\n    find_element_by_id(target, timeout)::\n\n        \u003e\u003e\u003e br.by_id(\"main_contents\")\n\n* by_name(target, eager=False, timeout=3)\n    find_element_by_name(target, timeout)::\n\n        \u003e\u003e\u003e br.by_name(\"page_password\")\n\n* by_linktxt(target, eager=False, timeout=3, partial=False)\n    find_element_by_link_text(target, timeout). if partial=True, then find_element_by_partial_link_text::\n\n        \u003e\u003e\u003e br.by_linktxt(\"Go back to\", partial=True)\n\n* href(partialurl=None, eager=False, timeout=3):\n    find_element_by_xpath(\"//a\", timeout). if partialurl was given, search 'a' tag which href contains partialurl::\n\n        \u003e\u003e\u003e phplinks = br.href(\".php\", eager=True)\n\n* img(alt=None, ext=None, eager=False, timeout=3)\n    find_elements_by_xpath(\"//img\", timeout)::\n\n        \u003e\u003e\u003e br.img(alt=\"I am sorry\", ext=\"sorry.gif\")\n\n* button(value, eager=False, timeout=3)\n    find_element_by_xpath(\"//input[@type='submit' or @type='button' and @value='{0}']|.//button[text()='{0}']\".format(value), timeout)::\n\n        \u003e\u003e\u003e br.button(\"Send this form\").click()\n\n* checkbox(self, eager=False, timeout=3, \\*\\*attributes)\n    Returns 'input' element type='checkbox'::\n\n        \u003e\u003e\u003e br.checkbox(name='checked_value', id='hoge')\n\n* radio(self, eager=False, timeout=3, \\*\\*attributes)\n    Retuns 'input' element type='radio'.::\n\n        \u003e\u003e\u003e br.radio(name='hoge', id='fuga').click()\n\n* select(self, eager=False, timeout=3, \\*\\*attributes)\n    Returns Select(self.by_tag(\"select\", eager, timeout, \\*\\*attributes) or their wrapped SeleniumContainerWrapper::\n\n        \u003e\u003e\u003e br.select(name=\"hoge\").select_by_index(1)\n        \u003e\u003e\u003e [select.is_multiple for select in br.select(eager=True, name=\"hoge\")]\n\nSeleniumContainerWrapper\n^^^^^^^^^^^^^^^^^^^^^^^^\n\n* size\n    Returns length of wrapped iterable::\n\n        \u003e\u003e\u003e br.img(eager=True).size\n\n* sample(size)\n    Returns random.sample(self._iterable, size)::\n\n        \u003e\u003e\u003e br.img(eager=True).sample(10)\n\n* choice()\n    Returns random.choice(self._iterable)::\n\n        \u003e\u003e\u003e br.img(eager=True).choice()\n\nRecent Change\n-------------\n* 0.5.4\n    * Add support for Python-3.4.\n    * Fix **button** to look for `\u003cbutton\u003e` tag.\n* 0.5.3\n    * Fix README\n* 0.5.2\n    * Add silent mode option.\n* 0.5.0\n    * Support Python3.\n* 0.4.3\n    * Add **perfomance**, **performance.timing**, **performance.navigation**, **performance.memory** properties.\n* 0.4.2\n    * Add 'PhantomJS' support.\n* 0.4.1\n    * Fixed some bugs.\n* 0.4.0\n    * Added **scroll_to**, **scroll_by**, **scroll_into_view** methods.\n* 0.3.5\n    * Added **attr** method.\n    * Fixed some typos.\n* 0.3.4\n    * Added size property to SeleniumContainerWrapper\n    * Fixed to be able to change default timeout.\n* 0.3.3\n    * Fixed bugs of string formatting.\n* 0.3.2\n    * Changed **alert** to wait until Alert's text is accesible.\n    * Override **current_url** to wait for page body loaded.\n* 0.3.1\n    * Added **connect** functon.\n* 0.3.0\n    * Changed **tag** method to **by_tag**.\n    * Added **checkbox**, **radio**.\n    * Changed **select** property to method.\n    * Added **sample**, **choice** methods to SeleniumContainerWrapper.\n    * Fixed **click** bug.\n* 0.2.4\n    * Fixed bug.\n* 0.2.3\n    * Added ext argument to **img** (alt and ext are both optional.)\n* 0.2.2\n    * Added new property **alert**\n    * Changed **img**'s argument from ext to alt( find_element_by_xpath(\"//img[@alt='{}'.format(alt)) )\n    * Modified SeleniumContainerWrapper's __contains__ behavior to unwrap given object if it is a SeleniumWrapper.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeitaoouchi%2Fseleniumwrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeitaoouchi%2Fseleniumwrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeitaoouchi%2Fseleniumwrapper/lists"}