Skip to main content

Selenium wrapper to make your life easy.

Project description

S-Tool

S-tool

Selenium wrapper to make your life easy

python selemium s-tool Python-World

Table of Contents

Key Features

  • WebDriver
    • Manage multiple web drivers such as chrome,chromium,firefox.
  • Different Utilities
    • Retrieve elements with 5 different attributes.
    • Perform clicks on element.
    • Take a full page and element screenshot.
    • Hide and show elements.
    • Information filling on different form elements such as text,radio,checkbox.
    • Retrieves current cookies from the browser.
    • Injecting new cookies into browser.
    • Retrieve url and web page source.
    • Add or modify existing cookies.
    • Retrieve current user agent.
    • Check Existence of an element on the page.
  • Element Parser
    • table Information.
    • Retrieve dropdown options in the dictionary.

How To Use

Install using PYPI

pip install s-tool

Setup for development

To clone and run this application, you'll need Git and Poetry and python Version ^3.8

# Clone this repository
git clone https://github.com/Python-World/s-tool.git

# Go into the repository
cd s-tool

# Install dependencies
poetry config virtualenvs.in-project true
poetry install

# Start Poetry shell
poetry shell

Note: If you're doing development setup, see this guide

Examples

Example 1

"""Example code with class"""

from s_tool.driver import SeleniumDriver


class SBot(SeleniumDriver):
   """Example Bot using s-tool"""

   def __init__(self, *args, **kwargs):
       super().__init__(*args, **kwargs)

   def run(self):
       self.get("https://google.com")
       sessionid = self.session()
       url = self.url()
       cookies = self.cookies()

       # print sessionid,url,cookies
       print(f"\n url     :   {url} \n session :   {sessionid}\n cookies :   {cookies}\n")


bot = SBot("firefox", headless=True)  # change headless=False to run with gui mode
bot.run()
bot.close()

Example 2

"""Example code with context manager"""

from s_tool.driver import SeleniumDriver as SBot

with SBot("firefox", headless=True) as obj:
   obj.get("https://google.com")
   sessionid = obj.session()
   url = obj.url()
   cookies = obj.cookies()

   # print sessionid,url,cookies
   print(f"\n url     :   {url} \n session :   {sessionid}\n cookies :   {cookies}\n")

Todo

  • Web driver utilities
    • Scrolling element and page.
    • Handling popup and alert boxes.
    • Switching windows,frames,tabs,iframes.
    • logger.
  • Element Parser
    • list
    • radio and checkboxes

Note: If you have any idea to improve or optimized in better way create issue for discussion.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

s-tool-0.0.3.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

s_tool-0.0.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file s-tool-0.0.3.tar.gz.

File metadata

  • Download URL: s-tool-0.0.3.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.0 Linux/5.4.0-80-generic

File hashes

Hashes for s-tool-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ee1eb9b8c60fcb719d824be9fc24da3631ace7b0099898b4864ebf4851fd5309
MD5 8430496d8bf37df2b72bba24277ae498
BLAKE2b-256 257ba0d5f57d27318f747433d2a3297e9c382d2d0c9462d509e9ad3a51b58caa

See more details on using hashes here.

File details

Details for the file s_tool-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: s_tool-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.0 Linux/5.4.0-80-generic

File hashes

Hashes for s_tool-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 000e6c056c7e1323b307ac1911b9c188cbf27b9c756775e02d31cc082215b536
MD5 ae412c3fb4d92da345f83270b1abdbf8
BLAKE2b-256 ff90f17220bbe1fbc8cc251c9b55c92ed76b4ee438a2223c8847b543679a102f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page