Skip to content

FastRPA

Python Tests Documentation Publish PyPI - Version Sponsor

A simple to use abstraction over Selenium.

  • Easy to use: complex interactions are abstracted to intuitive methods.
  • Clean imports: remove the necessity of import many packages and objects. Every automation features are accessible by methods of one main object.
  • Typed: type hints grant the code readability, and turn possible to navigate through the methods with any Intellisense tool.
  • Selenium safe: the core was developed following the Selenium best-practices. You can focus on business rules.

Installation

To perform a basic installation, just run:

pip install fastrpa

To install also, packages to help you to debug your application, install with debug extras:

pip install "fastrpa[debug]"

Your first instance

The FastRPA object, will prepare everything you need to start browse on the web. You can pass Selenium configurations to it. See here how to do it.

1
2
3
4
from fastrpa import FastRPA
app = FastRPA()
web = app.web()
type(web)
Output
fastrpa.app.Web

You can also instanciate a Web object and browse to an starter URL.

web = app.web('https://...')

The Web objects

Once you have a Web object, you are able to browse on the web. The Web class is a abstraction of main browser and user functions.

Get the current URL from the browser

web.url
Output
'https://www.site.com/mypage'

Get the domain from the current URL

web.domain
Output
'www.site.com'

Get the title from the current page

web.title
Output
'My website'

Get the HTML source-code from the current page

web.html
Output
'<html lang="en"><head>\n    <meta charset="utf-8">...'
web.browse('https://www.site.com/another_page')

Refresh the current page

web.refresh()

Check if an element is interactive on the screen

web.is_interactive('//*[@id="myElement"]')
Output
False

Get the text content from an element

web.read('//*[@id="myElement"]')
Output
'Any text'

Next steps