Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: WWW::Mechanize and input type=image

by dba (Monk)
on Oct 16, 2004 at 15:11 UTC ( [id://399771]=note: print w/replies, xml ) Need Help??


in reply to Re: WWW::Mechanize and input type=image
in thread WWW::Mechanize and input type=image

Thanks Steves. I have 2 follow-up questions.

1. How do I find out the co-ordinates, as there are many other "image buttons" in the same page.

Here is the expanded piece of HTML for clarity:
<tr> <td bgcolor="white"><img height="1" width="1" src="px.gif"></t +d> <td bgcolor="white" colspan="2"><input type="password" name="h +tmPassword" size="10" class="rtnavinput"></td> <td bgcolor="white"><input type=image src="/images/btnGoRed.gi +f" width="15" height="15" border="0"></td> <td bgcolor="white"><img height="1" width="1" src="px.gif"></t +d> </tr>


2. The syntax for "click" with coordinates is : $mech->click( $button [, $x, $y] ) What should I set $button to? There is no button name in the code.

Replies are listed 'Best First'.
Re^3: WWW::Mechanize and input type=image
by ikegami (Patriarch) on Oct 16, 2004 at 17:54 UTC
    I created this HTML:
    <form action="test.cgi" method="GET"> <tr> <td bgcolor="white"><img height="1" width="1" src="px. +gif"></td> <td bgcolor="white" colspan="2"><input type="password" + name="htmPassword" size="10" class="rtnavinput"></td> <td bgcolor="white"><input type=image src="/images/btn +GoRed.gif" width="15" height="15" border="0"></td> <td bgcolor="white"><img height="1" width="1" src="px. +gif"></td> </tr> </form>

    to see what gets sent. It fetches:

    .../test.cgi?htmPassword=&x=8&y=10

    So maybe you need to do something like this:

    $mech->set_fields(x => 1, y => 1); $mech->submit();

    The script probably doesn't attention to the x and y, in which case you could do simply:

    $mech->submit();

    (Untested, and I'd never used WWW::Mechanize.)

      Thanks for your input. However, a simple submit or submit_form is not working.

      FYI, there are several forms in the same page.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found