# Selench
Selench is a wrapper that simplifies the use of the Selenium library.
It provides a more concise syntax that makes the code more readable and easier to understand.
### Key Features
- Elements have an explicit wait time by default
- Element type detection ( CSS & XPATH )
## Installation
To install the library, use pip:
```bash
pip install selench
```
Alternatively, install the latest directly from the GitHub repository:
```bash
pip install git+https://github.com/dsymbol/selench.git
```
## Examples
Navigate to DuckDuckGo and search for 'Hello World!'
```py
from selench import Selench, Keys
driver = Selench()
driver.get('https://duckduckgo.com')
driver.element('[name=q]').send_keys('Hello World!', Keys.ENTER)
driver.quit()
```
Using PyTest: navigate to DuckDuckGo and search for 'github' assert titles contain 'github'
```py
from selench import Selench, Keys
import pytest
@pytest.fixture
def driver():
driver = Selench()
yield driver
driver.quit()
def test_ddg_search_query(driver):
keyword = 'github'
driver.get('https://duckduckgo.com/')
driver.element('[name=q]').send_keys(keyword, Keys.ENTER)
driver.wait_for.title_to_contain(keyword)
titles = driver.elements('a[data-testid=result-title-a] span')
for title in titles:
assert keyword in title.text.lower()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/dsymbol/selench",
"name": "selench",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "dsymbol",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ae/57/7b0be335c168b1389331a7bbd92a558830b6c065b8fb8fbfa5e80a00025e/selench-19.4.2024.tar.gz",
"platform": null,
"description": "# Selench\n\nSelench is a wrapper that simplifies the use of the Selenium library. \nIt provides a more concise syntax that makes the code more readable and easier to understand.\n\n### Key Features\n\n- Elements have an explicit wait time by default\n- Element type detection ( CSS & XPATH )\n\n## Installation\n\nTo install the library, use pip:\n\n```bash\npip install selench\n```\n\nAlternatively, install the latest directly from the GitHub repository:\n```bash\npip install git+https://github.com/dsymbol/selench.git\n```\n\n## Examples\n\nNavigate to DuckDuckGo and search for 'Hello World!'\n\n```py\nfrom selench import Selench, Keys\n\ndriver = Selench()\ndriver.get('https://duckduckgo.com')\ndriver.element('[name=q]').send_keys('Hello World!', Keys.ENTER)\ndriver.quit()\n```\n\nUsing PyTest: navigate to DuckDuckGo and search for 'github' assert titles contain 'github'\n\n```py\nfrom selench import Selench, Keys\nimport pytest\n\n@pytest.fixture\ndef driver():\n driver = Selench()\n yield driver\n driver.quit()\n\ndef test_ddg_search_query(driver):\n keyword = 'github'\n driver.get('https://duckduckgo.com/')\n driver.element('[name=q]').send_keys(keyword, Keys.ENTER)\n driver.wait_for.title_to_contain(keyword)\n titles = driver.elements('a[data-testid=result-title-a] span')\n\n for title in titles:\n assert keyword in title.text.lower()\n```\n",
"bugtrack_url": null,
"license": "OSI Approved :: MIT License",
"summary": "Selenium wrapper for Python",
"version": "19.4.2024",
"project_urls": {
"Homepage": "https://github.com/dsymbol/selench"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f86e6add5935d91ded8cd1cf8c8510aa4de6f38b0044028b6cbff0b87c4a3357",
"md5": "c70639057d8c446f39db9de9825d0992",
"sha256": "be2fbfcd5bab91a57163a6387ede920d1909c32237a0a32da0228a2e12bfad8f"
},
"downloads": -1,
"filename": "selench-19.4.2024-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c70639057d8c446f39db9de9825d0992",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10563,
"upload_time": "2024-04-18T21:29:04",
"upload_time_iso_8601": "2024-04-18T21:29:04.041425Z",
"url": "https://files.pythonhosted.org/packages/f8/6e/6add5935d91ded8cd1cf8c8510aa4de6f38b0044028b6cbff0b87c4a3357/selench-19.4.2024-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ae577b0be335c168b1389331a7bbd92a558830b6c065b8fb8fbfa5e80a00025e",
"md5": "7852eea1c6416ef43f4b36f8e5c2a64c",
"sha256": "fc995c0b173779f52d04d43db8351ece84e789badf2c9ecd6186735faac63778"
},
"downloads": -1,
"filename": "selench-19.4.2024.tar.gz",
"has_sig": false,
"md5_digest": "7852eea1c6416ef43f4b36f8e5c2a64c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12275,
"upload_time": "2024-04-18T21:29:05",
"upload_time_iso_8601": "2024-04-18T21:29:05.708768Z",
"url": "https://files.pythonhosted.org/packages/ae/57/7b0be335c168b1389331a7bbd92a558830b6c065b8fb8fbfa5e80a00025e/selench-19.4.2024.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-18 21:29:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dsymbol",
"github_project": "selench",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "selench"
}