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

Related tags

Testingsimpleselenium
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...
Python Webscraping using Selenium

Web Scraping with Python and Selenium The code shows how to do web scraping using Python and Selenium. We use as data the https://sbot.org.br/localize

This file will contain a series of Python functions that use the Selenium library to search for elements in a web page while logging everything into a file

element_search with Selenium (Now With docstrings 😎 ) Just to mention, I'm a beginner to all this, so it it's very possible to make some mistakes The

Compiles python selenium script to be a Window's executable

Problem Statement Setting up a Python project can be frustrating for non-developers. From downloading the right version of python, setting up virtual

Automated tests for OKAY websites in Python (Selenium) - user friendly version

Okay Selenium Testy Aplikace určená k testování produkčních webů společnosti OKAY s.r.o. Závislosti K běhu aplikace je potřeba mít v počítači nainstal

Whatsapp messages bulk sender using Python Selenium.

Whatsapp Sender Whatsapp Sender automates sending of messages via Whatsapp Web. The tool allows you to send whatsapp messages in bulk. This program re

reCaptchaBypasser For Bypass Any reCaptcha For Selenium Python

reCaptchaBypasser ' Usage : from selenium import webdriver from reCaptchaBypasser import reCaptchaScraper import time driver = webdriver.chrome(execu

Based on the selenium automatic test framework of python, the program crawls the score information of the educational administration system of a unive

whpu_spider 该程序基于python的selenium自动化测试框架,对某高校的教务系统的成绩信息实时爬取,在检测到成绩更新之后,会通过电子邮件的方式,将更新的成绩以文本的方式发送给用户,可以使得用户在不必手动登录教务系统网站时,实时获取成绩更新的信息。 该程序仅供学习交流,不可用于恶意攻

Percy visual testing for Python Selenium

percy-selenium-python Percy visual testing for Python Selenium. Installation npm install @percy/cli: $ npm install --save-dev @percy/cli pip install P

A Python Selenium library inspired by the Testing Library

Selenium Testing Library Slenium Testing Library (STL) is a Python library for Selenium inspired by Testing-Library. Dependencies Python 3.6, 3.7, 3.8

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
Code for "SUGAR: Subgraph Neural Network with Reinforcement Pooling and Self-Supervised Mutual Information Mechanism"

SUGAR Code for "SUGAR: Subgraph Neural Network with Reinforcement Pooling and Self-Supervised Mutual Information Mechanism" Overview train.py: the cor

41 Nov 08, 2022
A collection of benchmarking tools.

Benchmark Utilities About A collection of benchmarking tools. PYPI Package Table of Contents Using the library Installing and using the library Manual

Kostas Georgiou 2 Jan 28, 2022
Baseball Discord bot that can post up-to-date scores, lineups, and home runs.

Sunny Day Discord Bot Baseball Discord bot that can post up-to-date scores, lineups, and home runs. Uses webscraping techniques to scrape baseball dat

Benjamin Hammack 1 Jun 20, 2022
PoC getting concret intel with chardet and charset-normalizer

aiohttp with charset-normalizer Context aiohttp.TCPConnector(limit=16) alpine linux nginx 1.21 python 3.9 aiohttp dev-master chardet 4.0.0 (aiohttp-ch

TAHRI Ahmed R. 2 Nov 30, 2022
pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files

pytest-play pytest-play is a codeless, generic, pluggable and extensible automation tool, not necessarily test automation only, based on the fantastic

pytest-dev 67 Dec 01, 2022
🐍 Material for PyData Global 2021 Presentation: Effective Testing for Machine Learning Projects

Effective Testing for Machine Learning Projects Code for PyData Global 2021 Presentation by @edublancas. Slides available here. The project is develop

Eduardo Blancas 73 Nov 06, 2022
Ab testing - The using AB test to test of difference of conversion rate

Facebook recently introduced a new type of offer that is an alternative to the current type of bidding called maximum bidding he introduced average bidding.

5 Nov 21, 2022
Load and performance benchmark tool

Yandex Tank Yandextank has been moved to Python 3. Latest stable release for Python 2 here. Yandex.Tank is an extensible open source load testing tool

Yandex 2.2k Jan 03, 2023
create custom test databases that are populated with fake data

About Generate fake but valid data filled databases for test purposes using most popular patterns(AFAIK). Current support is sqlite, mysql, postgresql

Emir Ozer 2.2k Jan 04, 2023
Statistical tests for the sequential locality of graphs

Statistical tests for the sequential locality of graphs You can assess the statistical significance of the sequential locality of an adjacency matrix

2 Nov 23, 2021
Mypy static type checker plugin for Pytest

pytest-mypy Mypy static type checker plugin for pytest Features Runs the mypy static type checker on your source files as part of your pytest test run

Dan Bader 218 Jan 03, 2023
pywinauto is a set of python modules to automate the Microsoft Windows GUI

pywinauto is a set of python modules to automate the Microsoft Windows GUI. At its simplest it allows you to send mouse and keyboard actions to windows dialogs and controls, but it has support for mo

3.8k Jan 06, 2023
A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax

1.0 Release See here for details about breaking changes with the upcoming 1.0 release: https://github.com/taverntesting/tavern/issues/495 Easier API t

909 Dec 15, 2022
show python coverage information directly in emacs

show python coverage information directly in emacs

wouter bolsterlee 30 Oct 26, 2022
🏃💨 For when you need to fill out feedback in the last minute.

BMSCE Auto Feedback For when you need to fill out feedback in the last minute. 🏃 💨 Setup Clone the repository Run pip install selenium Set the RATIN

Shaan Subbaiah 10 May 23, 2022
How to Create a YouTube Bot that Increases Views using Python Programming Language

YouTube-Bot-in-Python-Selenium How to Create a YouTube Bot that Increases Views using Python Programming Language. The app is for educational purpose

Edna 14 Jan 03, 2023
Just for testing video streaming using pytgcalls.

tgvc-video-tests Just for testing video streaming using pytgcalls. Note: The features used in this repository is highly experimental and you might not

wrench 34 Dec 27, 2022
Enabling easy statistical significance testing for deep neural networks.

deep-significance: Easy and Better Significance Testing for Deep Neural Networks Contents ⁉️ Why 📥 Installation 🔖 Examples Intermezzo: Almost Stocha

Dennis Ulmer 270 Dec 20, 2022
Automated mouse clicker script using PyAutoGUI and Typer.

clickpy Automated mouse clicker script using PyAutoGUI and Typer. This app will randomly click your mouse between 1 second and 3 minutes, to prevent y

Joe Fitzgibbons 0 Dec 01, 2021
This is a Python script for Github Bot which uses Selenium to Automate things.

github-follow-unfollow-bot This is a Python script for Github Bot which uses Selenium to Automate things. Pre-requisites :- Python A Github Account Re

Chaudhary Hamdan 10 Jul 01, 2022