I tried to make the mechanize module work with GAE, but no luck. I used latest version of mechanize and the versions that are GAE specific from here Python Mechanize + GAEpython code.
What I want to do is to login to a website and submit a form.
Example code
import mechanize
def mech(uname,passw,txtto,msg):
br = mechanize.Browser()
br.open("http://example.com")
br.select_form(nr=0)
br["username"]= uname
br["password"]= passw
# br.form
response = br.submit()
br.select_form(nr=0)
# print br.form
br["txt"] = txtto
br["message"] = msg
br.submit()
br.back()
With mechanize module i get
'str' object has no attribute 'fileno'
and with gaemechanize i get
app.mechanize.ClientForm.ControlNotFoundError
ControlNotFoundError: no control matching name 'txt'
The code is tested and works outside gae so this is not the problem. I am using kay framework if this helps.