zeromq:官网 安装 demo及各语言绑定 golang绑定 实验环境:win10 x64/centos6 x86 zeromq4.0.6 zmq三种模式:push/pull、pub/sub、req/resp 一、push/pull模式: A程序PUSH代码如下: B程序PULL代码如下: A程 ...
分类:
其他好文 时间:
2018-02-09 15:10:41
阅读次数:
252
python 3.X版本是不需要安装:urllib2包的,urllib和urllib2包集合成在一个包了 那现在问题是: 在python3.x版本中,如何使用:urllib2.urlopen()? 答: import urllib.request resp=urllib.request.urlope ...
分类:
编程语言 时间:
2018-02-01 20:44:22
阅读次数:
291
static void Main(string[] args) { //WebRequest request = WebRequest.Create("http://www.cnblogs.com/mr-wuxiansheng/p/8353615.html"); //WebResponse resp ...
import cn.jpush.api.JPushClient;import cn.jpush.api.common.resp.APIConnectionException;import cn.jpush.api.common.resp.APIRequestException;import cn.j ...
分类:
其他好文 时间:
2018-01-27 19:01:21
阅读次数:
203
复制一下代码到相应位置 try: flag = False # 假如为True使用原来的代码,假如为Flase,使用requests库来访问 if flag: h = httplib2.Http() resp, content = h.request("http://bootswatch.com/a ...
分类:
其他好文 时间:
2018-01-11 22:26:35
阅读次数:
953
初学爬虫,整理一些相关知识,方便查询 1、urlopen 语法: resp = request.urlopen(url) #读取所有内容 resp.read() #读取指定n个内容 resp.read(n) #读取一行内容 resp.readline() #所有内容以行的形式读取 resp.read ...
分类:
Web程序 时间:
2018-01-11 20:36:17
阅读次数:
225
Requests库的使用 基于urllib改写的库 示例: 带参数的get请求 将返回的结果变为json格式 获取二进制数据 1 import requests 2 response=requests.get('https://weibo.com/favicon.ico') 3 print(resp ...
分类:
其他好文 时间:
2017-12-27 15:40:18
阅读次数:
1072
import geventfrom urllib.request import urlopen# 爬虫def f(url): print('GET: %s' % url) resp = urlopen(url) data = resp.read() with open('baidu.html', ' ...
分类:
编程语言 时间:
2017-12-14 21:12:01
阅读次数:
124
Ext.Ajax.request({ url: "...", method: "POST", params: { currentID: mainNode.attributes.id }, success: function (response) { var resp = Ext.decode(res ...
分类:
其他好文 时间:
2017-12-14 12:03:24
阅读次数:
735
Go语言中的HTTP client, server非常简单。具体如下。 HTTP Server HTTP Client 1. GET方式 2. POST方式 注意: response的Body使用后记得close,即: resp.Body.Close() 关于如何传递json格式数据,可以参考博文 ...
分类:
Web程序 时间:
2017-12-03 19:01:33
阅读次数:
270