本文整理汇总了Python中mechanize.Browser.form['text']方法的典型用法代码示例。如果您正苦于以下问题:Python Browser.form['text']方法的具体用法?Python Browser.form['text']怎么用?Python Browser.form['text']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mechanize.Browser
的用法示例。
在下文中一共展示了Browser.form['text']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _send_fired
# 需要导入模块: from mechanize import Browser [as 别名]
# 或者: from mechanize.Browser import form['text'] [as 别名]
def _send_fired(self):
br = Browser()
# Ignore robots.txt
br.set_handle_robots(False)
# Google demands a user-agent that isn't a robot
br.addheaders = [('User-agent', 'Firefox')]
# Retrieve the Google home page, saving the response
resp = br.open("https://www.t-mobile.cz/.gang/login-url/portal?nexturl=https%3A%2F%2Fwww.t-mobile.cz%2Fweb%2Fcz%2Fosobni")
br.select_form(nr=2)
br.form['username'] = 'kelidas'
br.form['password'] = self.password
resp = br.submit()
# print resp.get_data()
resp = br.open("https://sms.client.tmo.cz/closed.jsp")
br.select_form(nr=1)
# print br.form
# help(br.form)
br.form['recipients'] = self.phone_number # '736639077'#'737451193' #'605348558'
br.form['text'] = self.message
br.form.find_control("confirmation").get("1").selected = self.confirmation
resp = br.submit()
# logout
resp = br.follow_link(url_regex='logout')
br.close()
information(None, 'SMS sent!')