Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^11: Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()

by Corion (Patriarch)
on Jun 30, 2011 at 16:28 UTC ( [id://912207]=note: print w/replies, xml ) Need Help??


in reply to Re^10: Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()
in thread Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()

Ouch!

Looking at the source code as Firefox renders it, the problem becomes apparent immediately:

<form onsubmit="return validateDMPNameOnSubmit(this)" method="post" ac +tion="/goform/formHandlerConfigureDMPName"></form> <td width="5%"> <td width="45%">Digital Media Player Name:</td> <td width="50%"> <input type="text" maxlength="129" value="mmmmmmmm" name="DMPName"> <input type="submit" value="Apply"> </td>

Firefox happily (and likely in accordance with some HTML specification) moves all the input elements outside of the form, as the form nastily spans across <td> elemenst without respecting their allowed nesting.

As WWW::Mechanize::Firefox relies on Firefox doing the heavy lifting, there is nothing I can do. Maybe you can work around things by specifying explicit XPath expressions to get at the respective DOM elements.

Your post highlighted another error - currently, ->form_with_fields will not respect <select> or <textarea> elements - this will be changed in the next version.

  • Comment on Re^11: Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()
  • Select or Download Code

Replies are listed 'Best First'.
Re^12: Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()
by ajose (Acolyte) on Jun 30, 2011 at 18:09 UTC
    Thanks for the reply. I might use WWW::Mechanize to fill the problematic form. I can still use W::M::F for filling the form which has javascript.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 03:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found