用Python的urllib库提交WEB表单
2009-02-24 00:00
816 查看
class EntryDemo( Frame ): """Demonstrate Entrys and Event binding""" chosenrange = 2 url_login="http://.../ipgw/ipgw.ipgw/" uid = '' #用户名 password = '' # 密码 operation = '' # 操作 range = '2' # 范围 the_page = '' # WEB服务器返回页面 # 表单的INPUT 值一定要记得填齐全 def login(self): values = { 'uid' : self.uid, 'password' : self.password, 'operation' : self.operation, 'range' : self.range, # 1:国际 2:国内 'timeout':'0' } postdata = urllib.urlencode(values) # 表单值编码 req = urllib2.Request(self.url_login, postdata) # 服务器请求 response = urllib2.urlopen(req) self.the_page = response.read()
#print self.the_page
相关文章推荐
- Python3中利用Urllib进行表单数据提交(Get,Post)
- Python3中利用Urllib进行表单数据提交(Get,Post)
- pythonWeb编程提交表单方法
- Python3中利用Urllib进行表单数据提交(Get,Post)
- Python 提交表单数的一点简单介绍How to submit a web form
- java web解决表单重复提交
- JavaWeb -- Struts2,对比, 简单表单提交,校验,防重复提交, 文件上传
- struts2避免提交表单产生乱码的web.xml的配置
- Web表单提交之disabled问题js解决方法
- java web 防止表单重复提交解决方案
- 用Javascript同时提交多个Web表单的方法
- Other:web 表单数据提交方式get与post的区别
- python get,post提交表单
- python表单提交
- C#的提交表单方式主要有两种WebClient与HttpWebRequest
- Flask Web开发(一)基于python的Web表单
- Python 提交表单数的一点简单介绍
- web 界面设计---js提交表单
- VB与IE交互实现WEB画面的自动测试(用VB填写IE中控件的内容和提交表单)