开发者

not able to click a button in www::mechanize perl

after i filled a certain fo开发者_如何学Pythonrm, im trying to click this button

<input class="proceed" type="button" name="new_proceed" value="Create">

, when i tried

$mech->click_button(name=>"new_proceed");

it gives me an error telling me there's no clickable object with this name. and when used

$mech->click_button(value=>"Create");

i get can't call method "header" on an undefined value at C:/strawberry/perl/site/lib/WWW/Mechanize.pm line 2467.

So whats wrong? Thanks


<input class="proceed" type="button" name="new_proceed" value="Create">

Since it is of type button, it doesn't do anything in HTML (it is usually used as something to bind JavaScript to, which WWW::Mechanize doesn't support).

Look to something that supports JS such as WWW::Mechanize::Firefox instead.


Try $mech->click_button(name=>"new_proceed");


try using HTML::Forms.. U can get the form info from the view source and you can click the button .. Another option is $mech->request .. u can create a request using make_request once u r done with filling up the form and then use $mech->request

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜