Using the example below. I have an HTML file parsed using Mojo::DOM. However I encounter a scenario in one of the pages has two classes that I need (Question and Answer) to read comprising of a Label with its corresponding textbox that needs filling. I am having problem retrieving the Label and its corresponding textbox so that I can fill in the right values into the right box.
<td class="Question">1</td>
<td class="Answer"><input type="text"/></td>
<td class="Question">2</td>
<td class="Answer"> <input type="text"/></input></td>
<td class="Question">3</td>
</td class="Answer"><input type="text"/></td>
Please any ideas on how I can go about it using perl? Please note that the innertext for each label do change per script run.
After fiddling with Mojo::Dom I was able to select the value of the labels , I then combined it with WWW::Mechanize to fill it into the input text boxes.
The array it return leaves it in order that I wanted. I got a reference from http://blogs.perl.org/users/joel_berger/2012/05/using-mojodom.html which really helped in case anyone is in need of an easy to use tool.