Python package to easily work with selenium and manage tabs effectively.

Overview

Simple Selenium

The aim of this package is to quickly get started with working with selenium for simple browser automation tasks.

Installation

Install from PyPI

pip install simpleselenium

Features

Some basic feature is being listed below.

  • easy management of different tabs
  • switching to a tab is super easy
  • know if a tab is active or alive
  • closing a tab is easy as browser.close_tab(tab_object)
  • Several (built-in) functions
    • tab.infinite_scroll()
    • tab.scroll()
    • tab.scroll_to_bottom()
    • tab.click(element_on_page)
    • tab.switch() to focus on tab i.e. make it the active tab
  • Can't find a way to use usual selenium methods? Use tab.driver object to access the browser/driver object and use accordingly

Usage

The best way to getting started with the package is to use the Browser object to start a browser and call open method off it which returns a Tab object.

Browser

import time  # just to slow down stuffs and see things for testing
from simpleselenium import Browser

chrome_driver = r"/path/to/chromedriver"

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

    print(yahoo)  # A Tab Object
    print(yahoo.is_alive)
    print(yahoo.is_active)
    print(dir(yahoo))  # All methods and attributes of Tab Objects

    print(browser.get_all_tabs())  # List of tab objects

    print(browser.tabs.all())
    print(browser.tabs)  # TabManager object
    print(dir(browser.tabs))  # All methods and attributes of TabManager Objects

    browser.close_tab(bing)  # close a browser tab
    print(browser.tabs.all())

    print(browser.get_current_tab())  # current tab
    time.sleep(5)

    yahoo.switch()  # switch/focus/tap to/on `yahoo` tab
    print(browser.get_current_tab())
    time.sleep(5)

    google.switch()
    print(browser.get_current_tab())
    time.sleep(5)

    browser.close_tab(yahoo)
    time.sleep(5)

    print(google.driver)  # Usual selenium driver object which can be worked upon

    print(google.driver.title, google.title)

    print(google.scroll_to_bottom())
    print(google.is_active)
    print(google.is_alive)
    print(bing.is_alive)  # False, it has been deleted.

    print(browser.get_all_tabs())

TODO

  • Complete documentation
  • Test Code
You might also like...
A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities.

Awesome WordPress A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities. Inspired by bayand

A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings.
A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings.

Suspend WP A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings. 😎 Demo (coming so

Scaffold plugin for creating and managing Blocks, Block Patterns, Block Styles and Block Editor Sidebars in the WordPress Block Editor (aka Gutenberg).
Scaffold plugin for creating and managing Blocks, Block Patterns, Block Styles and Block Editor Sidebars in the WordPress Block Editor (aka Gutenberg).

WordPress Block Editor Scaffold This project is a template repo for developing WordPress Blocks, Block Patterns, Block Styles and Block Editor Sidebar

Generates a list of WordPress actions and filters from code and outputs them as JSON

wp-hooks-generator Generates a JSON representation of the WordPress actions and filters in your code. Can be used with WordPress plugins, themes, and

Beauty and simple Wordpress video player plugin. Powerfull and lite in use.
Beauty and simple Wordpress video player plugin. Powerfull and lite in use.

Sonic Spectre Video Player Beauty and simple Wordpress video player plugin. Powerfull and lite in use. Quick Start: Download plugin from this repo and

Wordless is a junction between a WordPress plugin and a theme boilerplate that dramatically speeds up and enhances your custom theme creation
Wordless is a junction between a WordPress plugin and a theme boilerplate that dramatically speeds up and enhances your custom theme creation

Wordless is a junction between a WordPress plugin and a theme boilerplate that dramatically speeds up and enhances your custom theme creation. Some of

Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple
Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

Documents WordPress Classic Editor integration points and their Gutenberg equivalents

Gutenberg Migration Guide This repository documents WordPress Classic Editor customization points and their Gutenberg equivalents (if such exist). Its

The easiest way to develop and release Gutenberg blocks (components) for WordPress

Contents Install Comparison with competition Future Plans Usage Creating a Block Install npm install gutenblock -g This is a Gutenberg plugin creator

Releases(0.1.0)
  • 0.1.0(Oct 27, 2021)

    First Release.

    • easy management of different tabs
    • switching to a tab is super easy
    • know if a tab is active or alive
    • closing a tab is easy as browser.close_tab(tab_object)
    • Several (built-in) functions
      • tab.infinite_scroll()
      • tab.scroll()
      • tab.scroll_to_bottom()
      • tab.click(element_on_page)
      • tab.switch() to focus on tab i.e. make it the active tab
    • Can't find a way to use usual selenium methods? Use tab.driver object is access the browsr/driver and use accordingly
    Source code(tar.gz)
    Source code(zip)
    simpleselenium-0.1.0-py3-none-any.whl(7.39 KB)
    simpleselenium-0.1.0.tar.gz(6.64 KB)
Owner
Vishal Kumar Mishra
Vishal Kumar Mishra
WPCloudDeploy is a WordPress plugin that allows you to easily deploy servers at major cloud-server providers and then install apps

WPCloudDeploy is a WordPress plugin that allows you to easily deploy servers at major cloud-server providers and then install apps

WPCloudDeploy 41 Dec 24, 2022
A PHP Class for creating Wordpress Custom Post Types easily

N.B I've released an updated version of the project to a new repository, PostTypes. WP Custom Post Type Class v1.4 A single class to help you build mo

Joe Grainger 412 Nov 25, 2022
Ormapker is a wordpress plugin to embbed a multilocations map easily.

ORMAPKER Ormapker is a wordpress plugin to embbed a multilocations map easily. License This plugin is released under the GNU General Public License Ve

Said Gamih 1 Aug 10, 2022
A WordPress plugin that demonstrates how to easily add frontend interactivity with Alpinejs.

Add Alpinejs to Custom Gutenberg Blocks Is there a fun/easy/lightweight way to add frontend interactivity to custom Gutenberg blocks w/o using React o

null 9 Apr 20, 2022
Laravel Blog Package. Easiest way to add a blog to your Laravel website. A package which adds wordpress functionality to your website and is compatible with laravel 8.

Laravel Blog Have you worked with Wordpress? Developers call this package wordpress-like laravel blog. Contact us for any customization: contact@binsh

Binshops 279 Dec 28, 2022
A WordPress package for updating custom plugins and themes based on an API response from a custom update server.

WordPress Update Handler A WordPress package for updating custom plugins and themes based on an JSON REST API response from a custom update server. Ch

WP Forge 7 Oct 5, 2022
A package that makes creating WordPress settings pages a breeze.

WP Settings This package aims to make it easier to create settings pages for WordPress plugins. Typically, you would use the Settings API or write som

Jeffrey van Rossum 43 Nov 24, 2022
Composer install helper outsourcing sensitive keys from the package URL into environment variables

private-composer-installer This is a Composer plugin offering a way to reference private package URLs within composer.json and composer.lock. It outso

Fränz Friederes 213 Dec 12, 2022
🚀WordPress Plugin Boilerplate using modern web techs like TypeScript, SASS, and so on... on top of a local development environment with Docker and predefined GitLab CI for continous integration and deployment!

WP React Starter: WordPress React Boilerplate DEPRECATED: WP React Starter was a "research project" of devowl.io for the development of our WordPress

devowl.io GmbH 344 Jan 1, 2023
This WP plugin will update GitHub, Bitbucket, GitLab, and Gitea hosted plugins and themes

Transition from GitHub Updater 9.x to Git Updater 10.x Due to the renaming of the plugin folders and files, after the initial update, the plugin will

Andy Fragen 3k Jan 5, 2023