GithubHelp home page GithubHelp logo

form-bot's Introduction

Form Bot

This project allows automated responses to a form.

How to use it?

To use it, clone the repository :

git clone [email protected]:kiitoss/form-bot.git
cd form-bot

Then, add a data.json file containing a structure similar to the data-sample.json file.

Then run the project using :

python3 main.py

Explanation of the data.json file

The JSON object contains 2 attributes:

  • url : url of the form to be filled in automatically
  • instructions : a list of instructions to be performed
{
  "url": "https://xxx.com", // url of the form
  "repetitions": 5, // nb of forms to be sent
  "instructions": [
    // page 1
    [
      {
        "selector": "button[type='submit']",
        "action": "click"
      }
    ],
    // page 2
    [
      {
        "selector": ".radio-button",
        "action": "click"
      },
      {
        "selector": ".textarea.content",
        "action": "write",
        "value": "This is the new content of the textarea."
      },
      {
        "selector": "button[type='submit']",
        "action": "click"
      }
    ]
  ]
}

The instructions are grouped in sub-lists to visually separate the pages of a form.

Add a new instruction

A statement can contain the following properties:

  • selector : the css selector of the HTML element
  • action : the action to be performed on the selected element
  • value : (optional) the value used for the action

The possible actions are :

  • click : click on the selected object
{
  "selector": "button[type='submit']",
  "action": "click"
}
  • write : write the value contained in the "value" attribute
{
  "selector": ".textarea.content",
  "action": "write",
  "value": "This is the new content of the textarea."
}

form-bot's People

Contributors

kiitoss avatar

Stargazers

Idriss avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.