Automatically fill a form from

Background

There is a website with a form that I need to fill automatically and then submit. Once this is done I need to check the results page and send a message to a user via Whatsap, Telegram or SMS. Sending an email is not out of question, but this is related to an extremely urgent event (like, the nuclear core is melting down) so I am not sure emails are a good choice because people miss them easily.

Questions

I am usually more of a back-end developer, I don’t know much about reading pages and filling them automatically. So naturally I have some questions:

  1. Is it possible to do this with server side technologies using Elixir?
  2. What tools would you use and why?
  3. I know of Bamboo to send e-mails in Elixir, but I don’t know of any tool to send other types of notifications. Do you know any?

Any help would be really appreciated.

1 Like

do you mean filling out form on 3rd party site and scrape/parse the result? then something like wallaby maybe - though it’s oriented towards testing… https://github.com/elixir-wallaby/wallaby

or hound https://hex.pm/packages/hound

  1. nexmo, or twilio for sms - u can even call up people and have it read whatever text you want…
1 Like

Unless this form is protected against CSRF, you could just write a small script to cURL POST the form, and pipe the answer to Telegram if it matches your alerting conditions.

Avoid SMS, as those come with no guarantee to go fast.

3 Likes

Hi @Fl4m3Ph03n1x

do you have resolved your issue? I would be interestet in the solution path you took, as I am doing the same thing.

Thanks for a quick reply und enjoy the evening.

Well, nowadays what I usually do is:

  • Check the network tab of your browser to see what type of requests being sent
  • Once I identify the request (usually a POST) I then study its data (does it send a payload? What is the format of such payload?)
  • With this information, I then use something like HTTPoison or Finch to make a request to that endpoint with the data I want

This effectively “emulates” a user, provided you also sent the credentials in the POST request.