1def Findsubmit(link):
2 global reqlist
3 try:
4 br = mechanize.Browser() # initiating the browser
5 br._factory.is_html = True
6 br.addheaders = [('User-agent',
7 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
8 br.open(str(link), timeout=15)
9 if br.forms():
10 params = list(br.forms())
11 for par in params:
12 for p in par.controls:
13 ps = str(p)
14 # print p.name
15 if 'TextControl' in ps:
16 param = str(p.name)
17 reqstr = par.action + par.method + param
18 if reqstr not in reqlist:
19 reqlist.append(reqstr)
20 testxss(par.action, par.method, param)
21 except Exception, e:
22 print e
23 pass