jcarlosroldan / autoselenium

Ready-to-run Selenium.
MIT License
3 stars 1 forks source link

AutoSelenium: Ready-to-run Selenium

This Python 3 library solves most of the problems usually found when using Selenium.

Installing

  1. Install a version of Firefox compatible with geckodriver 0.26.0 (see this compatibility table)
  2. Install this library via pip using: pip install autoselenium

Usage

>>> from autoselenium import Firefox
>>>
>>> driver = Firefox(headless=True)
>>>
>>> driver.get('https://juancroldan.com')
>>> driver.find_element_by_tag_name('div').get_attribute('outerHTML')
'<div id="mw-page-base" class="noprint"></div>'
>>>
>>> driver.get_with_render('https://juancroldan.com')
>>> driver.find_element_by_tag_name('div').get_attribute('outerHTML')
'<div id="mw-page-base" class="noprint"\
    data-xpath="/html[1]/body[1]/div[1]"\
    data-computed-style="align-content:normal;align-items:normal;...;z-index:auto"\
    data-width="1356" data-height="80"\
    data-width-rel="1" data-height-rel="0.11527377521613832"></div>'

This library only have one class: Firefox, a child of selenium.drivers.Firefox with extended construction parameters:

It also implements one extra function, driver.get_with_render(url, render_selector='body'), which works the same way as driver.get(url), processing the nodes selected by render_selector with a few rendering operations:

Features

Contributions ✨

You can take any of the pending enhancements, work on it and open a pull request.

Changes

Find here the changes on this library (from recent to older) and the features of each version. We follow Semantic Versioning 2.0.0 guidelines to improve the dependency management automation.

v0.1.0

Relased on Oct 28, 2019.

v0.0.1

Released on Oct 10, 2019.