The goal of this project is to facilitate the creation of automations without the need to create complex scripts.
Before you start, please make sure you meet the following requirements:
Python >= 3.6
Before running the automation, create a folder called scripts
within the project directory, add a .json
file and configure it according to your needs.
When you finish the previous step, go to main.py
and change the path of the example.json
file to the path where your file is, then, just go to the terminal and run the following command:
Ps: If you don't have the required libraries, don't worry, the script will install them automatically
- Windows:
python main.py
- Linux \ MacOs:
python3 main.py
Example
Ps: The items inside the process
attribute can be named however you like with any amount
{
"url": "any url",
"process": {
"First Step": [],
"Second Step": []
}
}
{
"First Step": [
{
"find": "",
"element": "",
"multiple": true,
"action": "",
"value": "",
"press_key": "",
"select_by": "",
"rule": [
{
"type": "",
"settings": {
"by": "",
"name": "",
"expected": "",
"return": ""
}
}
],
"child": {
"find": "",
"element": "",
"action": "",
"value": ""
},
"sleep": 0
}
]
}
This attribute tells you which attribute of the element will be used to perform the search, these are the options:
id
xpath
link text
partial link text
name
tag name
class name
css selector
This attribute receives the value needed to perform the search of the element, it must match the type of search that is being used in the find
attribute.
This attribute will be necessary if you need to make a less precise search that returns more than one element.
This attribute is necessary when you want to perform some action under the element, these are the options:
click
send_keys
select
This attribute is needed when the attribute value action
is send_keys
or select
, the script will send the value assigned here to the running element.
This attribute is necessary when the value of the action
attribute is select
, so that the script will know where to look for the value assigned in the value
attribute.
These are the options:
value
index
visible_text
This attribute can be added when the value of the action
attribute is send_keys
, the options can be found here
Ps: Just put the name of the key
This attribute can be used if you want to perform some rule on the received elements.
It can only be used if the multiple
attribute is present.
These are the options:
-
This attribute defines what type of rule will be executed, these are the options:
filter
-
This attribute defines what settings are used in the rule, these are the options:
by name expected return
-
This attribute receives a value to find inside the element, these are the options:
attr
-
Receives the value needed to perform the search of the element, it must match the type of search that is being used in the
by
attribute. -
Takes the experienced or unexperienced value within the answer found by the
by
attribute.
Ps: If the value is not expected, addnotExpected:
before the value to be found. -
If you want to change the filter return, you can use this attribute for that.
These are the options:
- returns all elements
- related to the index will return the related element.
-
You can also put expressions, such as
"1:4"
or":1"
-
This attribute receives a value to find inside the element, these are the options:
This attribute is used in case you need to perform actions on certain elements that are not interactable through a single find.
You can have as many children as you like, as along as you keep one child per child.
It has the same settings as a find of any other element.
Example:
{
"find": "",
"element": "",
"child": {
"find": "",
"element": "",
"child": {
"find": "",
"element": "",
"action": "",
"value": ""
}
}
}
This project is under the MIT license. See the file LICENSE for more details.