Perl-Mechanize posting hidden form value -


i attempting create perl script test web form me. using mechanize automation , having trouble finding documentation on the field method. using field method return value of hidden form , causing post fail. problem simple oversight curious $mech->field('name'); seems returning hidden form's value me.

using perl v5.16.3 (w & w/o warnings)

$id = $test->field('mid');   print $id . " \n";            #this printing desired id ,           #the post  not succeed long $id assigned way.   print "this attempting upload images\n"; $fileuploadresult; $fileuploadresult = $mech->post($uploadurl,     'content_type' => "multipart/form-data",     'content' => [     'myfile' => $file , 'mid' => $id     ]     ); print $fileuploadresult->content() . "\n\n\n"; #if set $id 'test' #will work fine. #i using 2 agent because there 2 post's going on , have sequential. 

i wondering why submit failed when grabbed value of form. changed 'field' method 'value' , realized fixed problem. sorry noob question didn't @ documentation enough. when field returned value assumed part of functionality did not realize set value null. (or far can tell doing)


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -