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>
In reply to YouTube and Mechanize form submission by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |