Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: WWW::Mechanize and text input outside form

by Corion (Patriarch)
on Jan 05, 2005 at 18:40 UTC ( [id://419694]=note: print w/replies, xml ) Need Help??


in reply to WWW::Mechanize and text input outside form

No. Or rather, in principle yes, but it won't work as you want it to work, as input fields outside of form tags will never be submitted by the browser, except via Javascript. And WWW::Mechanize does not understand Javascript.

  • Comment on Re: WWW::Mechanize and text input outside form

Replies are listed 'Best First'.
Re^2: WWW::Mechanize and text input outside form
by Kanji (Parson) on Jan 05, 2005 at 22:16 UTC

    Although you could rewrite the HTML so that the input field was inside the form tags...

    # untested; salt to taste my $html = $mech->content; $html =~ s/(<input[^>]+>)(.*?<form[^>]*>)/$2$1/; $mech->update_html($html);

        --k.


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-19 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found