Robert Poor
2011-Dec-21 04:41 UTC
[Mechanize-users] creating a Mechanize::Form from scratch...
I need to POST a form that doesn''t originate from a GET[*]. I know what belongs in the form. It''s not clear to me how to create a Mechanize::Form from scratch -- the only way I can see to do it is GET a page that has a form on it, strip its contents and repopulate it. But is there an easier (or less surprising) way to do this? - ff [*] If you must know, the site I''m working with uses javascript to construct and post forms, so Mechanize doesn''t have an obvious form to work with.
Eric Hodel
2011-Dec-21 04:55 UTC
[Mechanize-users] creating a Mechanize::Form from scratch...
On Dec 20, 2011, at 8:41 PM, Robert Poor wrote:> I need to POST a form that doesn''t originate from a GET[*]. I know > what belongs in the form. It''s not clear to me how to create a > Mechanize::Form from scratch -- the only way I can see to do it is GET > a page that has a form on it, strip its contents and repopulate it. > But is there an easier (or less surprising) way to do this?You can place an HTML form in a file and load it from a file:// URL which has an action that points to the http:// URL to submit to.