import sys
import mechanize
import cookielib
br = mechanize.Browser()
cj = cookielib.LWPCookieJar()
br.set_cookiejar(cj)
br.open('http://stu.szu.edu.cn:8080/account/signin/')
br.select_form(nr=0)
br.form['username'] = ['92']
br.form['password'] = 'office789'
response = br.submit() #上面几步是模拟登陆以获得cookies
print response.read()
reload(sys)
sys.setdefaultencoding('utf-8')
br.open('http://stu.szu.edu.cn:8080/meeting_room/apply/')
br.select_form(nr=0)
br.form['meeting_topic'] = 'HYZT'
br.form['applicant_name'] = 'SQRXM'
br.form['applicant_phone_number'] = '00123456'
br.form['applicant_stu_id'] = '2015300025'
br.form['applicant_college'] = 'SQRXY'
br.form["place"] = ["石头坞一楼会议室"]
br.form["date_month"] = ["8"]
br.form["date_day"] = ["24"]
br.form["date_year"] = ["2018"]
br.form["time"] = ["8点-8点30分","8点30分-9点"]
br.form['meeting_summary'] = 'meeting_summary'
br.form['remarks'] = 'remarks'
response = br.submit()
print response.read()
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。