Selenium wrapper to make your life easy.
Project description
S-Tool
Selenium wrapper to make your life easy
Table of Contents
Key Features
- WebDriver
- Manage multiple web drivers such as chrome,chromium,firefox.
- Different Utilities
- Retrieve element with 5 different attribute.
- Perform clicks on element
- Take full page and element screenshot.
- Hide and show elements.
- Information filling on different form elements such as text,radio,checkbox.
- Retrieves current cookies from browser.
- Retrieve url and web page source
- Element Parser
- table Information
- Retrieve dropdown options in 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"\nurl : {url} \nsession : {sessionid}\ncookies : {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"\nurl : {url} \nsession : {sessionid}\ncookies : {cookies}\n")
Todo
- Web driver utilities
- Scrolling element and page.
- Handling popup and alert boxes.
- Switching windows,frame,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
Project details
Release history Release notifications | RSS feed
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.2.tar.gz
(8.1 kB
view details)
Built Distribution
File details
Details for the file s-tool-0.0.2.tar.gz
.
File metadata
- Download URL: s-tool-0.0.2.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.0 Linux/5.4.0-77-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 680169fcb102a145aa32f848fba5b26d581713a58843488abc1459c7efb72787 |
|
MD5 | f0b47b19f3719339d56d58b579b8dbc2 |
|
BLAKE2b-256 | 30ee7b9664915bf3a871e5983797041a4b134763151535de9b118ae23b63873c |
File details
Details for the file s_tool-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: s_tool-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.0 Linux/5.4.0-77-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bc8c4a8812cdd891b84c704bfe25ed28d3b88d374f5e1f87bbf955d114fe1fe |
|
MD5 | e5843b5070d7adfaac979055aa10a97d |
|
BLAKE2b-256 | 589ff4cb06349fac8cd9fd486ab97632ad04b745649a65ae76c947f2a2f21767 |