本文整理汇总了Python中mechanize.Browser.form["email"]方法的典型用法代码示例。如果您正苦于以下问题:Python Browser.form["email"]方法的具体用法?Python Browser.form["email"]怎么用?Python Browser.form["email"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mechanize.Browser
的用法示例。
在下文中一共展示了Browser.form["email"]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_fb_status
# 需要导入模块: from mechanize import Browser [as 别名]
# 或者: from mechanize.Browser import form["email"] [as 别名]
def update_fb_status(email, password, message):
"""Takes the message and update facebook status.
"""
browser_obj = Browser()
browser_obj.open("http://lite.facebook.com/")
browser_obj.select_form(nr=0)
browser_obj.form["email"] = email
browser_obj.form["password"] = password
browser_obj.submit()
# Update status
browser_obj.select_form(nr=1)
browser_obj.form["message"] = message
browser_obj.submit()
示例2: raw_input
# 需要导入模块: from mechanize import Browser [as 别名]
# 或者: from mechanize.Browser import form["email"] [as 别名]
if(accountId == ''):
print "Type your pairing code"
pair_code = raw_input("> ")
response = api.pair(pair_code)
responseData = response.get_data()
accountId = responseData["accountId"]
f.write(accountId)
f.close()
# Use of mechanize to enter in our fb account
br = Browser()
br.set_handle_robots(False)
br.open('https://m.facebook.com/login.php?next=https://m.facebook.com/settings/security/?active_sessions')
br._factory.is_html = True
br.select_form(nr=0)
br.form["email"] = USER
br.form["pass"] = PASSWD
br.submit()
# Infinite loop checking for unauthorized sessions
while True:
time.sleep(TIME)
br.open("https://m.facebook.com/settings/security/?active_sessions")
br._factory.is_html = True
br.select_form(nr=1)
try:
for i in range(0, len(br.find_control(type="checkbox").items)):
br.find_control(type="checkbox").items[i].selected = True
sessions_detected = True
except:
print '[+] No active sessions'