I'm using the following code to extract the hidden values from an HTML page. Is there any way that I can extract only specific hidden values or any other values matching the criteria defined in look_down method. In this case I want only recid1,country values

I tried passing array reference to name, but it isn't working for me...any Ideas please

use strict; use warnings; use HTML::TreeBuilder; my $t = HTML::TreeBuilder->new_from_file(*DATA); my @hidden_inputs = $t->look_down( _tag => q{input}, type => q{hidden}, name => q{recid1}, ); for my $hidden_input (@hidden_inputs){ printf qq{*%s*\n}, $hidden_input->attr(q{value}); } __DATA__ <html><head> <title>Data</title> </head> <form name="action"> <table cellspacing="1" cellpadding="1"> <tr> <td>File name</td> <td>From To</td> <td>Svc</td> <td>Period</td> <td>Seq#</td> <td>Reason for Rejection</td> <td>Next Action</td> <td>Country</td> </tr> <tr> <td>Sample.XML</td> <td><a href='dch_redirect?refer=10293377&ref=10293377'>USA-IND</a></ +td> <td>Voice</td> <td><input type="hidden" name="recid1" value="10293377">2009/08</td> <td>03386</td> <td>data already exists</td> <td><input type="checkbox" name="c_1"></td> <td><input type="hidden" name="country" value="America">USA</td> </tr> </body></html>

In reply to Get specific values from look_down method of HTML::TreeBuilder by kalyanrajsista

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.