python - 使用GET和post
来源:互联网 发布:淘宝网买东西怎么付款 编辑:程序博客网 时间:2024/05/20 02:55
GET
import urllib2 response = urllib2.urlopen('http://www.baidu.com/') html = response.read() print html
POST
import urllib2import urllib #定义一个要提交的数据数组(字典)data = {}data['username'] = 'admin'data['password'] = '123456' #定义post的地址url = 'http://www.baidu.com/'post_data = urllib.urlencode(data) #提交,发送数据req = urllib2.urlopen(url, post_data) #获取提交后返回的信息content = req.read()
0 0
- python - 使用GET和post
- python post和get请求使用
- python get和post请求
- Python--get和post请求
- Python -- 使用requests模块发送GET和POST请求
- python 使用requests 实现 post 和get请求
- python爬虫get和post方法的使用以及cookie
- python 使用urllib2发送get请求和post请求
- GET和POST的使用
- perl 使用post和get
- GET 和 POST 何时使用
- python urllib/urllib2 get/post使用详解
- Python发送GET和POST请求
- python发送post和get请求
- Python的POST和GET方法
- Python发get和post请求
- python 关于post和get的区别
- Python爬虫中的Get和Post方法
- 考试总结
- spring AOP中自身方法调用无法应用代理解决办法
- java.sql.SQLException: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general
- 静态注册广播监听网络变化
- 百度云盘+SVN 心得
- python - 使用GET和post
- 06 (补充)初始化sdram代码
- C#之DataSet和DataTable
- mysql启动的四种方式
- 《Android群英传》读书笔记5.Android Scroll分析
- JS获取浏览器高度和宽度
- Python3 百度图片 美女 下载 爬虫 多线程
- Android程序员学PHP开发(17)-callback-readdir-is_dir-foreach-glob-PhpStorm
- 使用iso文件创建本地安装源 - centos7环境