문제

I am trying to use mechanize to click what appears to be a button, however, when I look at the CSS it seems to be a form field.

<input type="submit" name="tbe_cws_submit" value="Search" style="
padding:2px;
color:#FFFFFF;
border-left: 2px solid #11A9F7;
border-bottom:1px solid #333333;
border-right:1px solid #333333;
border-top:2px solid #11A9F7;
font-size: 10px;
font-weight: bold;
font-family:Verdana;" tabindex="13">

When looking at the page from irb, using mechanize, here is what I see.

:028 > page.forms[0].fields[4]
 => [text:0xddbe6c type: text name: ctl00$quickSearch$txtQuickSearch value: Search] 
도움이 되었습니까?

해결책

Try submitting the enclosing form, thats what clicking the submit button would do.

page.forms[0].submit

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top