Skip to content

Console

To run javascript on the current page, you can use the following methods.

Accessing the object

1
2
3
app = FastRPA()
web = app.browse('https:...')
type(web.console)
Output
fastrpa.core.console.Console

Reference

Evaluate a simple expression

web.console.evaluate('2 + 2')
Output
4

Run multi line scripts

1
2
3
4
web.console.run([
    'button = document.getElementById("myButton")',
    'button.click()'
])

Run a javascript file

web.console.run_script('/path/to/script.js')