Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Everything looks like it gets set properly but it never actually submits the form. I've also posted the source code behind the webpage if that helps below:... $mech->follow_link( text => "Add as Friend"); my $page = $mech->content; my $hidden_id = $1 if $page =~ m/\<input type\=\"hidden\" name\=\" +friend_id\" value=\"(.*)\"\>/; my $friend_id = 'http://youtube.com/my_friends_invite_user?friend_ +id=' .$hidden_id; # print "FRIEND ID: $friend_id\n"; $mech->add_header( Referer => $friend_id ); $mech->form_number(3); my $form = $mech->form_number(3); $form->find_input('friend_id')->readonly(0); $mech->set_fields(friend_id => $hidden_id); $mech->field('group', 'Friends' ); $mech->click_button(name => 'action_invite');
I'm obviously missing something so any and all suggestions are welcome.<form method="post" action="my_friends_invite_user"> <input type="hidden" name="friend_id" value="JMwzlfI6UQU"> <tr> <td class="formLabel">Username:</td> <td class="formField"><a href="/profile?user=wasteofaces">wasteo faces</a></td> </tr> <tr valign="top"> <td class="formLabel">Add As:</td> <td class="formField"> <select name="group"> <option value="">---</option> <option value="Family" >Family</option> <option value="Friends" SELECTED>Friends</option> </select> <div class="smallText">This person will be able to see the pri +vate videos you share with these groups in addition to your public vi +deos. </div> </td> </tr> <tr> <td class="formLabel"> </td> <td class="formField"><input type="submit" name="action_invite" +value="Send Invite"></td> </tr> </form>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: YouTube and Mechanize form submission
by pemungkah (Priest) on Sep 12, 2007 at 20:06 UTC | |
|
Re: YouTube and Mechanize form submission
by mmmmtmmmm (Monk) on Sep 13, 2007 at 01:43 UTC | |
|
Re: YouTube and Mechanize form submission
by technojosh (Priest) on Sep 12, 2007 at 19:34 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |