in reply to How to fill textarea of a webpage fetched using WWW::Mechanize::Firefox ?

What about simple XPath (if you have only one textarea):
my $textarea = $mech->xpath('//textarea', one => 1); $textarea->value("somevalue");

Replies are listed 'Best First'.
Re^2: How to fill textarea of a webpage fetched using WWW::Mechanize::Firefox ?
by strawperl (Initiate) on May 10, 2015 at 05:35 UTC

    I guess this is the solution that Corion suggested (to fetch the textarea as an object and then use the ->value method). I used this code trying both the absolute xpath and '//textarea' (the page has only one textarea).

    line 52 my $textarea = $mech->xpath('//textarea', one => 1);

    line 53 $textarea->value("somevalue");

    I got the below error-

    MozRepl::RemoteObject: TypeError: f.apply is not a function at getpage.pl line 53