simpleselenium


Namesimpleselenium JSON
Version 0.4.4 PyPI version JSON
download
home_pagehttps://github.com/TheConfused/simpleselenium
SummaryPython package to easily work with Selenium.
upload_time2023-09-17 16:42:44
maintainer
docs_urlNone
authorVishal Kumar Mishra
requires_python>=3.10,<4.0
licenseMIT
keywords selenium selenium python selenium python automation python automation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Simple Selenium: Enhanced Tab Management for Selenium

Simplify your web automation tasks with **Simple Selenium**, a Python package that takes Selenium to the next level with streamlined tab management and additional features.

### Installation

Install **Simple Selenium** from PyPI with ease:

```bash
pip install simpleselenium
```

### Core Idea

In **Simple Selenium**, a `browser` contains multiple `tabs`, enabling you to interact with web pages more efficiently. You can perform various actions on both `Tab` and `Browser` objects, making web automation a breeze.

**Actions/Activities on `Tab` Objects:**
- Check tab status (open/closed)
- Switch to a specific tab
- Access page source, title, and headings
- Inject jQuery and select elements
- Perform actions on a specific tab (e.g., click, scroll)
- CSS selection made easy

**Actions/Activities on `Browser` Objects:**
- Open new tabs with URLs
- Retrieve a list of open tabs
- Switch to a specific tab (first, last, or any)
- Close a tab
- Close the entire browser

### Working with Driver Objects

A `driver` object is available on any `Tab` object, allowing you to access the browser/driver object and use Selenium methods when needed.

### Features

**Simple Selenium** offers a range of features to enhance your web automation tasks:
- Effortless tab management
- Seamless tab switching
- Real-time tab status tracking
- Convenient tab closure
- Built-in functions for scrolling, clicking, and more
- Access to the underlying Selenium `driver` object for advanced usage

### Usage

To get started with **Simple Selenium**, create a `Browser` object and open tabs using the `open` method:

#### Browser

```python
from simpleselenium import Browser, Tab

# Create a `Browser` object, specifying the browser name (e.g., "Chrome").
# The project automatically downloads drivers.

with Browser(name="Chrome", implicit_wait=10) as browser:
    google: Tab = browser.open("https://google.com")
    yahoo = browser.open("https://yahoo.com")
    bing = browser.open("https://bing.com")
    duck_duck = browser.open("https://duckduckgo.com/")

    # Scroll on the page (example)
    yahoo.scroll_to_bottom()

    # Working with tabs
    assert len(browser.tabs) == 4
    assert google in browser.tabs
    assert browser.tabs[0] == google

    for tab in browser.tabs:
        print(tab)

    print(browser.tabs)
    print(browser.current_tab)

    # Selecting elements with JQuery (using Browserjquery package)
    print(yahoo.jq("a"))

    # Selecting using CSS Selectors (no JQuery needed)
    for item in yahoo.css(".stream-items"):
        for a in item.css("a"):
            print(a, a.text)

    # Some `Tab` attributes/properties
    print(google.title)
    print(google.url)
    print(google.page_source)

    # Closing a tab
    browser.close_tab(bing)

    # Switching to a tab
    yahoo.switch()
    google.switch()

    # Accessing the driver object
    print(google.driver.title, google.title)
```

### TODO

- Complete documentation

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TheConfused/simpleselenium",
    "name": "simpleselenium",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "selenium,selenium python,selenium python automation,python automation",
    "author": "Vishal Kumar Mishra",
    "author_email": "vishal.k.mishra2@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e1/9a/b882f656b156ad7d3ba17275a8bc599a0a245aef0adec49574db8a570dc1/simpleselenium-0.4.4.tar.gz",
    "platform": null,
    "description": "# Simple Selenium: Enhanced Tab Management for Selenium\n\nSimplify your web automation tasks with **Simple Selenium**, a Python package that takes Selenium to the next level with streamlined tab management and additional features.\n\n### Installation\n\nInstall **Simple Selenium** from PyPI with ease:\n\n```bash\npip install simpleselenium\n```\n\n### Core Idea\n\nIn **Simple Selenium**, a `browser` contains multiple `tabs`, enabling you to interact with web pages more efficiently. You can perform various actions on both `Tab` and `Browser` objects, making web automation a breeze.\n\n**Actions/Activities on `Tab` Objects:**\n- Check tab status (open/closed)\n- Switch to a specific tab\n- Access page source, title, and headings\n- Inject jQuery and select elements\n- Perform actions on a specific tab (e.g., click, scroll)\n- CSS selection made easy\n\n**Actions/Activities on `Browser` Objects:**\n- Open new tabs with URLs\n- Retrieve a list of open tabs\n- Switch to a specific tab (first, last, or any)\n- Close a tab\n- Close the entire browser\n\n### Working with Driver Objects\n\nA `driver` object is available on any `Tab` object, allowing you to access the browser/driver object and use Selenium methods when needed.\n\n### Features\n\n**Simple Selenium** offers a range of features to enhance your web automation tasks:\n- Effortless tab management\n- Seamless tab switching\n- Real-time tab status tracking\n- Convenient tab closure\n- Built-in functions for scrolling, clicking, and more\n- Access to the underlying Selenium `driver` object for advanced usage\n\n### Usage\n\nTo get started with **Simple Selenium**, create a `Browser` object and open tabs using the `open` method:\n\n#### Browser\n\n```python\nfrom simpleselenium import Browser, Tab\n\n# Create a `Browser` object, specifying the browser name (e.g., \"Chrome\").\n# The project automatically downloads drivers.\n\nwith Browser(name=\"Chrome\", implicit_wait=10) as browser:\n    google: Tab = browser.open(\"https://google.com\")\n    yahoo = browser.open(\"https://yahoo.com\")\n    bing = browser.open(\"https://bing.com\")\n    duck_duck = browser.open(\"https://duckduckgo.com/\")\n\n    # Scroll on the page (example)\n    yahoo.scroll_to_bottom()\n\n    # Working with tabs\n    assert len(browser.tabs) == 4\n    assert google in browser.tabs\n    assert browser.tabs[0] == google\n\n    for tab in browser.tabs:\n        print(tab)\n\n    print(browser.tabs)\n    print(browser.current_tab)\n\n    # Selecting elements with JQuery (using Browserjquery package)\n    print(yahoo.jq(\"a\"))\n\n    # Selecting using CSS Selectors (no JQuery needed)\n    for item in yahoo.css(\".stream-items\"):\n        for a in item.css(\"a\"):\n            print(a, a.text)\n\n    # Some `Tab` attributes/properties\n    print(google.title)\n    print(google.url)\n    print(google.page_source)\n\n    # Closing a tab\n    browser.close_tab(bing)\n\n    # Switching to a tab\n    yahoo.switch()\n    google.switch()\n\n    # Accessing the driver object\n    print(google.driver.title, google.title)\n```\n\n### TODO\n\n- Complete documentation\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python package to easily work with Selenium.",
    "version": "0.4.4",
    "project_urls": {
        "Homepage": "https://github.com/TheConfused/simpleselenium",
        "Repository": "https://github.com/TheConfused/simpleselenium"
    },
    "split_keywords": [
        "selenium",
        "selenium python",
        "selenium python automation",
        "python automation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "424ae15f3d4f848c787c6043a8cae47e7d982963ef6736c6218ba7113f3d3aee",
                "md5": "0a288e3c9bb505dd198a780f18a3adb8",
                "sha256": "294c67b593b1c0d45a2d16fdc1eef50b9311fdd6f6482673a4c24190618f258e"
            },
            "downloads": -1,
            "filename": "simpleselenium-0.4.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0a288e3c9bb505dd198a780f18a3adb8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 40967,
            "upload_time": "2023-09-17T16:42:43",
            "upload_time_iso_8601": "2023-09-17T16:42:43.364103Z",
            "url": "https://files.pythonhosted.org/packages/42/4a/e15f3d4f848c787c6043a8cae47e7d982963ef6736c6218ba7113f3d3aee/simpleselenium-0.4.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e19ab882f656b156ad7d3ba17275a8bc599a0a245aef0adec49574db8a570dc1",
                "md5": "21431ad8fa7708182d1bad2198a0cb1b",
                "sha256": "f148d29bf2b703f6f59c1fcf8cff481a1377971a0c85c7f4f575fd43d533d7f8"
            },
            "downloads": -1,
            "filename": "simpleselenium-0.4.4.tar.gz",
            "has_sig": false,
            "md5_digest": "21431ad8fa7708182d1bad2198a0cb1b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 37920,
            "upload_time": "2023-09-17T16:42:44",
            "upload_time_iso_8601": "2023-09-17T16:42:44.958497Z",
            "url": "https://files.pythonhosted.org/packages/e1/9a/b882f656b156ad7d3ba17275a8bc599a0a245aef0adec49574db8a570dc1/simpleselenium-0.4.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-17 16:42:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TheConfused",
    "github_project": "simpleselenium",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "simpleselenium"
}
        
Elapsed time: 0.23777s