Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by Gangabass (Vicar)
on May 10, 2015 at 00:38 UTC ( [id://1126218]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1126218]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-19 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found