Skip to main content

auto-selenium

Auto-Selenium is a Python tool to automate the download of Selenium Web Drivers and store the profile sessions for the following browsers:

  • Google Chrome
  • Firefox
  • Opera
  • Brave
  • Edge (only for Windows)

It utilizes Selenium and MSEdge tools

Quickstart examples

Installation

pip install auto-selenium

Simple Usage

from autoselenium import Driver

with Driver('chrome', root='drivers') as driver:
    driver.get('https://www.google.com/')
    # Selenium Webdriver command examples
    driver.find_elements_by_tag_name('div')
    driver.refresh()

Downloads driver based on current version of the browser. When it is used as a context manager, the driver returns Selenium's WebDriver object.

Download specific versions of each driver

from autoselenium import download_driver, get_version

download_driver('firefox', version='0.29.1', root='drivers')
download_driver('opera', 'latest')

cversion = get_version('brave', 'current')
lversion = get_version('brave', 'latest')

if cversion < lversion:
    print('You should update your browser!')

You can specify between 'current', 'latest' or input an specific version for a driver.

Create your custom driver

import autoselenium

class TwitterBot(autoselenium.Driver):
    
    _URL = 'https://twitter.com'
    
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.logged = False
    
    def login_required(func):
        def logged_checker(self, *args, **kwargs):
            if not self.logged:
                self.log()
            return func(self, *args, **kwargs)
        return logged_checker    
    
    def log(self):
        self.logged = True
        pass
    
    @login_required
    def scrape(self):
        pass

Contribute

Would you like to contribute to this project? Here are a few starters:

  • Improve documentation
  • Add Testing examples
  • Bug hunts and refactor
  • Additional features/ More integrations
  • Phantom JS support
  • Implement default browser functions for Mac

Metadata

Release files for auto-selenium 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for auto-selenium 1.0.1
File Size Uploaded
auto-selenium-1.0.1.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for auto-selenium 1.0.1
File Interpreter ABI Platform
auto_selenium-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.7 kB

Release files / auto-selenium-1.0.1.tar.gz

Download URL auto-selenium-1.0.1.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
63a702fce0bfccd987e1d99b1efbed66ae941e2190641e5b9b43d708fdcccf09
BLAKE2b-256 checksum
How to use checksums
c6bd725e2052a7116f937d651ed8ffdd28e46daff5a5bcba54814961a0778446
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

Release files / auto_selenium-1.0.1-py3-none-any.whl

Download URL auto_selenium-1.0.1-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b08ef52a7f4618a6cd0974ebfde53ead89e2203332251af95de5cbbfc62be515
BLAKE2b-256 checksum
How to use checksums
00a827ba8bad300fe52b15b4b6e56e00c44348fdbeffafb65c306b0cd6138200
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page