All Projects → mherrmann → Selenium Python Helium

mherrmann / Selenium Python Helium

Licence: mit
Selenium-python but lighter: Helium is the best Python library for web automation.

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to Selenium Python Helium

google-meet-bot
Bot for scheduling and entering google meet sessions automatically
Stars: ✭ 33 (-98.79%)
Mutual labels:  webdriver, selenium, selenium-python
Undetected Chromedriver
Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
Stars: ✭ 365 (-86.64%)
Mutual labels:  selenium, webdriver, chrome
WaWebSessionHandler
(DISCONTINUED) Save WhatsApp Web Sessions as files and open them everywhere!
Stars: ✭ 27 (-99.01%)
Mutual labels:  firefox, selenium, web-scraping
TestLeafSeleniumTraining
This is public repository for Selenium Learners at TestLeaf
Stars: ✭ 80 (-97.07%)
Mutual labels:  firefox, webdriver, selenium
Docker Python Xvfb Selenium Chrome Firefox
Dockerfiles for Python 3.6/2.7 & Selenium in a headless Chrome or Firefox environment
Stars: ✭ 82 (-97%)
Mutual labels:  selenium, chrome, firefox
Dockselpy
Dockerized Selenium and Python with support for Chrome, Firefox and PhantomJS
Stars: ✭ 237 (-91.33%)
Mutual labels:  selenium, chrome, firefox
Singlefile
Web Extension for Firefox/Chrome/MS Edge and CLI tool to save a faithful copy of an entire web page in a single HTML file
Stars: ✭ 4,417 (+61.68%)
Mutual labels:  selenium, chrome, firefox
Cdp4j
cdp4j - Chrome DevTools Protocol for Java
Stars: ✭ 232 (-91.51%)
Mutual labels:  selenium, webdriver, chrome
Arsenic
Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Stars: ✭ 209 (-92.35%)
Mutual labels:  webdriver, chrome, firefox
Marionette client
Mozilla's Gecko Marionette client in golang
Stars: ✭ 21 (-99.23%)
Mutual labels:  selenium, webdriver, firefox
Etaoin
Pure Clojure Webdriver protocol implementation
Stars: ✭ 599 (-78.07%)
Mutual labels:  webdriver, chrome, firefox
Marionette
Selenium alternative for Crystal. Browser manipulation without the Java overhead.
Stars: ✭ 119 (-95.64%)
Mutual labels:  selenium, webdriver, firefox
Sillynium
Automate the creation of Python Selenium Scripts by drawing coloured boxes on webpage elements
Stars: ✭ 100 (-96.34%)
Mutual labels:  web-scraping, selenium, chrome
Seleniumbase
A Python framework that inspires developers to become better test automation engineers. 🧠💡
Stars: ✭ 2,520 (-7.76%)
Mutual labels:  selenium, webdriver, selenium-python
Rester
A REST client for almost any web service (Firefox and Chrome Extension)
Stars: ✭ 192 (-92.97%)
Mutual labels:  chrome, firefox
Thirtyfour
Selenium WebDriver client for Rust, for automated testing of websites
Stars: ✭ 191 (-93.01%)
Mutual labels:  selenium, webdriver
Chromeless
🖥 Chrome automation made simple. Runs locally or headless on AWS Lambda.
Stars: ✭ 13,254 (+385.14%)
Mutual labels:  selenium, chrome
Emoji Helper
A small cross-browser emoji cheatsheet extension 👍
Stars: ✭ 194 (-92.9%)
Mutual labels:  chrome, firefox
Bet On Sibyl
Machine Learning Model for Sport Predictions (Football, Basketball, Baseball, Hockey, Soccer & Tennis)
Stars: ✭ 190 (-93.05%)
Mutual labels:  web-scraping, selenium
Ad Detector
Detects articles with corporate sponsors.
Stars: ✭ 194 (-92.9%)
Mutual labels:  chrome, firefox

Selenium-python but lighter: Helium

Selenium-python is great for web automation. Helium makes it easier to use. For example:

Helium Demo

Under the hood, Helium forwards each call to Selenium. The difference is that Helium's API is much more high-level. In Selenium, you need to use HTML IDs, XPaths and CSS selectors to identify web page elements. Helium on the other hand lets you refer to elements by user-visible labels. As a result, Helium scripts are typically 30-50% shorter than similar Selenium scripts. What's more, they are easier to read and more stable with respect to changes in the underlying web page.

Because Helium is simply a wrapper around Selenium, you can freely mix the two libraries. For example:

# A Helium function:
driver = start_chrome()
# A Selenium API:
driver.execute_script("alert('Hi!');")

So in other words, you don't lose anything by using Helium over pure Selenium.

In addition to its more high-level API, Helium simplifies further tasks that are traditionally painful in Selenium:

  • Web driver management: Helium ships with its own copies of ChromeDriver and geckodriver so you don't need to download and put them on your PATH.
  • iFrames: Unlike Selenium, Helium lets you interact with elements inside nested iFrames, without having to first "switch to" the iFrame.
  • Window management. Helium notices when popups open or close and focuses / defocuses them like a user would. You can also easily switch to a window by (parts of) its title. No more having to iterate over Selenium window handles.
  • Implicit waits. By default, if you try click on an element with Selenium and that element is not yet present on the page, your script fails. Helium by default waits up to 10 seconds for the element to appear.
  • Explicit waits. Helium gives you a much nicer API for waiting for a condition on the web page to become true. For example: To wait for an element to appear in Selenium, you would write:
    element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.ID, "myDynamicElement"))
    )
    With Helium, you can write:
    wait_until(Button('Download').exists)

Installation

To get started with Helium, you need Python 3 and Chrome or Firefox.

If you already know Python, then the following command should be all you need:

pip install helium

Otherwise - Hi! I would recommend you create a virtual environment in the current directory. Any libraries you download (such as Helium) will be placed there. Enter the following into a command prompt:

python3 -m venv venv

This creates a virtual environment in the venv directory. To activate it:

# On Mac/Linux:
source venv/bin/activate
# On Windows:
call venv\scripts\activate.bat

Then, install Helium using pip:

python -m pip install helium

Now enter python into the command prompt and (for instance) the commands in the animation at the top of this page (from helium import *, ...).

Your first script

I've compiled a cheatsheet that quickly teaches you all you need to know to be productive with Helium.

API Documentation

The documentation for this project can be found here.

Status of this project

I have too little spare time to maintain this project for free. If you'd like my help, please go to my web site to ask about my consulting rates. Otherwise, unless it is very easy for me, I will usually not respond to emails or issues on the issue tracker. I will however accept and merge PRs. So if you add some functionality to Helium that may be useful for others, do share it with us by creating a Pull Request. For instructions, please see Contributing below.

How you can help

I find Helium extremely useful in my own projects and feel it should be more widely known. Here's how you can help with this:

  • Star this project on GitHub.
  • Tell your friends and colleagues about it.
  • Share it on Twitter with one click
  • Share it on other social media
  • Write a blog post about Helium.

With this, I think we can eventually make Helium the de-facto standard for web automation in Python.

Contributing

Pull Requests are very welcome. Please follow the same coding conventions as the rest of the code, in particular the use of tabs over spaces. Also, read through my PR guidelines. Doing this will save you (and me) unnecessary effort.

Before you submit a PR, ensure that the tests still work:

pip install -Ur requirements/test.txt
python setup.py test

This runs the tests against Chrome. To run them against Firefox, set the environment variable TEST_BROWSER to firefox. Eg. on Mac/Linux:

TEST_BROWSER=firefox python setup.py test

On Windows:

set TEST_BROWSER=firefox
python setup.py test

If you do add new functionality, you should also add tests for it. Please see the tests/ directory for what this might look like.

History

I (Michael Herrmann) originally developed Helium in 2013 for a Polish IT startup called BugFree software. (It could be that you have seen Helium before at https://heliumhq.com.) We shut down the company at the end of 2019 and I felt it would be a shame if Helium simply disappeared from the face of the earth. So I invested some time to modernize it and bring it into a state suitable for open source.

Helium used to be available for both Java and Python. But I because I now only use it from Python, I didn't have time to bring the Java implementation up to speed as well. Similarly for Internet Explorer: Helium used to support it, but since I have no need for it, I removed the (probably broken) old implementation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].