I am developing a Perl script which takes user input and generate multiple outputs related to the user input. But What i want to do is that fill a certain website with the end results of my program. I read the documentation and fallowed some examples in WWW::Mechanize but I am still struggling to figure it out..
I have the fallowing the HTML and in that I have two fields that I would like to fill in with the results generated by my Perl script.
<div id="treeform" class="treeformWide">
<form>
<div id="elementsContainer" class="clearfix">
<div class="formElement">
<label for="firstName">Your First Name</label>
<input id="tree_fn" size="15" type="text">
</div>
<div class="formElement">
<label for="lastName">Your Last Name</label>
<input id="tree_ln" size="15" type="text">
</div>
<div class="formElement">
<label for="gender">YourGender</label>
<select id="tree_gen" name="gender">
<option selected="selected"value="M">Male</option>
<option value="F">Female</option></select>
</div>
</div>
<div style="text-align: center; clear: both; padding-top: 10px;">
<input name="start" class="p_btn" id="star
+t" value="Get Started" onclick="submitInfo();s_objectID='hp_build_tre
+e';return false;" type="submit">
</div>
</form>
</div>
Here is the part of the my code that use the WWW:Mechanize, My code has other parts which are not related to the WWW:Mechanize, I didn't put all the code since those are not relevant to WWW::Mechanize.
#!/usr/bin/perl
use Text::Soundex;
use LWP;
use WWW::Mechanize;
my $mechObject = WWW::Mechanize->new();
$mechObject -> get($url);
$mechObject->field($queryString);
$mechObject->click();
It will be a great help if someone could guide me on this..
Thanks in advance..