Now we will see an example of how to fill forms in a web page. Filling forms is actually the same as we have done when doing web searches, but this time we are going to execute a process that will fill a form that adds information into a web page.
For this example we are going to use a task management site called Toodledo (http://www.toodledo.com/). Sign up for a free account if you don't have one already, and write down your credentials. We will create a wrapper that adds new tasks to your todo list:
Create a new wrapper called "toodledoadd".
In your Init component wizard add the following parameters for the wrapper:
|Field name||Data type||Constraints|
|password||string||mandatory and hidden|
Create a new sequence component that receives the Start_1_output value as an input record.
Record a navigation sequence to http://www.toodledo.com/tasks/index.php?signedup=1 , which is the URL of the main page of the task management UI in Toodledo.
The sequence will first pass through the login dialog, so go ahead and record the steps needed to log in (setting your login and password in the text fields and clicking on "Sign in").
Once authenticated, we have to record the following events:
After the sequence is recorded, import it in the Sequence wizard.
Save the wrapper.
This wrapper is very simple but showcases how to build a wrapper that instead of extracting data from a website puts information back into the web. Traditional use cases for this type of interaction are websites that store results of some process or data analysis that has been carried out within Denodo.
You could also build a second wrapper for getting the current tasks out of Toodledo, and a third one for marking a task as completed. This way you will have a solution for interacting programatically with your TODO list, creating a pseudo-API when there is none offered by the service provider.