in reply to WWW::Mechanize & HTML

You can find the name by looking for the name="something" tag in the form or input tags, but as you have discovered, there is no requirement for them to be named at all, the form you have here doesn't have a name. WWW::Mechanize also lets you select forms by number, rather than name, so you can use $agent->form_number(1) to select the form you want to work with, and can just use $agent->submit() to submit the form, and just ignore the buttons altogether.


We're not surrounded, we're in a target-rich environment!

Replies are listed 'Best First'.
Re: Re: WWW::Mechanize & HTML
by Anonymous Monk on Oct 08, 2003 at 13:36 UTC
    Great! Thank you very much. I was trying to use click('button_name') or just click() it wasn't working. I'll try submit().

    Also, I tried using the readmore tag followed by code then my code block followed by a /code tag and then a /readmore (with <> around them of course) and the readmore didn't work. Do youo know what I did wrong? Thanks again.

Re: Re: WWW::Mechanize & HTML
by Anonymous Monk on Oct 08, 2003 at 14:02 UTC
    click() and submit() failed and now I know why. I used response() to get the following error message.
    <HEAD><TITLE>An Error Occurred</TITLE></HEAD> <BODY> <H1>An Error Occurred</H1> 401 Authorization Required </BODY> </HTML>
    When I get() the form I do it like this.
    get("http://name:password\@www.site.com/page.htm")
    So I should already be authorized right? I'm not sure what I'm doing wrong. Any ideas?
      Actually the get looks like this
      get("http://name:pwd\@www.site.com/subdir/_vti_bin/shtml.exe/post.htm? +106");