Using Python and Mechanize with ASP Forms

Posted by tchaymore on Stack Overflow See other posts from Stack Overflow or by tchaymore
Published on 2010-04-21T00:28:27Z Indexed on 2010/04/21 0:33 UTC
Read the original article Hit count: 426

Filed under:
|
|

I'm trying to submit a form on an .asp page but Mechanize does not recognize the name of the control. The form code is:

<form id="form1" name="frmSearchQuick" method="post">
....
<input type="button" name="btSearchTop" value="SEARCH" class="buttonctl" onClick="uf_Browse('dledir_search_quick.asp');" >

My code is as follows:

br = mechanize.Browser()
br.open(BASE_URL)
br.select_form(name='frmSearchQuick')
resp = br.click(name='btSearchTop')

I've also tried the last line as:

resp = br.submit(name='btSearchTop')

The error I get is:

raise ControlNotFoundError("no control matching "+description) ControlNotFoundError: no control matching name 'btSearchTop', kind 'clickable'

If I print br I get this: IgnoreControl(btSearchTop=)

But I don't see that anywhere in the HTML.

Any advice on how to submit this form?

© Stack Overflow or respective owner

Related posts about python

Related posts about asp