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 hashes)
Built Distribution
s_tool-0.0.2-py3-none-any.whl
(8.0 kB
view hashes)