🌐Script with Standalone Pylenium
How to use Pylenium in a regular script instead of in a test
Setup
Pylenium needs two things in order to be instantiated:
PyleniumConfig
Pylenium
Create a main.py
file and add the necessary imports:
main.py
Create an instance of PyleniumConfig
Start by creating an instance of PyleniumConfig. Leaving it blank will create a config with default values. NOTE: This does not use pylenium.json
Default config
To use pylenium.json
, you'd have to read the file first:
Use pylenium.json
You can set config values directly in the script - mixing and matching as needed
Create an instance of Pylenium
Once the config is ready, instantiate Pylenium with it:
Write your Script
You now have access to Pylenium's many commands to script what you need:
Google Search
Run your Script
Use python to execute main.py
Last updated