Re: Finding form field for this html



Nospam wrote:
I can't seem to find the form field or even form name for this particular
page, the relevant html is:

<form method="post" action="/cgi-bin/add_posting.pl" name="add_posting">
<input type="hidden" name="changedImages" value="">
<input type="hidden" name="pid" value="4112">
<input type="hidden" name="posting_cat" value="3749">
<input type="hidden" name="action" value="preview_or_images">
<input type="hidden" name="site_id" value="79">
<input type="hidden" name="posting_id" value="">

I have tried form(1); and it states there is no such form, I have also tried
form("add_posting.pl") and it said no such form "add_posting", the url to
the site is http://hull.gumtree.com/cgi-bin/add_posting.pl?posting_cat=3749


Works for me.


mark@owl:~/Dev/perl$ cat form.pl
use strict;
use warnings;

use Data::Dumper;
use WWW::Mechanize;

my $mech = WWW::Mechanize->new();

my $url = q(http://hull.gumtree.com/cgi-bin/add_posting.pl?posting_cat=3749);
my $form_name = q(add_posting);

$mech->get( $url );

my $form = $mech->form_name($form_name);

print $form->method()."\n";
print $form->action()."\n";
print join "\n",$form->param(),"\n";

mark@owl:~/Dev/perl$ perl form.pl
POST
http://hull.gumtree.com/cgi-bin/add_posting.pl
changedImages
pid
posting_cat
action
site_id
posting_id
current_live_date
location
location_required
title
description
contact_email
other_contactable
skype_id
anonymous_email
anti_spam
first_name
last_name
user_email
password
action_images
action_preview

mark@owl:~/Dev/perl$
.