"Peter Stevens" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi everyone,
>
> I am trying to sign in to a site. The form consists of a username and
> password field. No problem. But the action attribute of the Form is set
> to nil (""). So mech->submit invokes the wrong url.
>
> Looking at the form, I find the routine below to validate the password
> and determine where the form should be POSTed to. I can figure out what
> the action URL should be. But I do tell Mechanize where it should post to?
>
> Thanks in advance
>
> Peter
>

Call the action method of the form object and pass in the desired URL:

$agent->form_name( $fName )->action( $action );
#  -or-
$agent->current_form->action( $action );

This will set the forms action to the desired URL.

Todd W.


Reply via email to