views:

240

answers:

1

Hello, check the following script:

from mechanize import Browser

br = Browser()
page = br.open('http://scottishladiespool.com/register.php')

br.select_form(nr = 5)

r = br.click(type = "submit", nr = 0)
print r.data
#prints username=&password1=&password2=&email=&user_hide_email=1&captcha_code=&user_msn=&user_yahoo=&user_web=&user_location=&user_month=&user_day=&user_year=&user_sig=

that is, it doesn't add the name=value pair of the submit button (register=Register). Why is this happening? ClientForm is working properly on other pages, but on this one it is not. I've tried setting the disabled and readonly attributes of submit control to True, but it didn't solve the problem.

+2  A: 

There is a disabled=disabled attribute on the register button. This prevents the user from clicking and presumably mechanize respects the disabled attribute as well.

You'll need to change the source code of that button. Enabling the control means completely removing the disabled=disabled text.

Triptych
Weird, I've tried it before sending the question and it didn't work, now it does)
roddik
Heh - trust me we've all been there.
Triptych