摘要: 1. 下载:https://www.apache.org/dyn/closer.cgi?path=/kafka/2.5.0/kafka_2.12-2.5.0.tgz 2. 解压tar -xzvf kafka_2.12-2.5.0.tgz 3. 启动zookeeper ./bin/zookeeper- 阅读全文
posted @ 2020-05-13 17:48 sunshine_5 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 格式化字符串时,如果字符中包含%,需要用%对%进行转义,即%% >>> a= "%%%s%%"%("abc")>>> a'%abc%' 阅读全文
posted @ 2020-05-13 17:20 sunshine_5 阅读(2953) 评论(0) 推荐(0) 编辑
摘要: 1. 抓不到接口,不要着急提取页面信息,先搜索下网络资源,没准就有人分享对应的接口信息。 2 抓取页面信息,一定先用导出curl 相关命令,一般情况下能正常返回页面信息,尽量不要selenium启动页面抓取 3. url中包含#,要去掉 4. requests请求一定要带着user-agent,否则 阅读全文
posted @ 2020-05-12 23:04 sunshine_5 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 验证css:$$('title') 验证xpath: $x('//h2') 阅读全文
posted @ 2020-05-12 17:15 sunshine_5 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 服务端修改: 1. 服务端/etc/rsyncd.conf port = 3380pid file = /var/run/rsyncd.pidlog file = /var/log/rsyncd.loguid = rootgid = rootuse chroot = nomax connection 阅读全文
posted @ 2020-05-12 14:33 sunshine_5 阅读(554) 评论(0) 推荐(0) 编辑
摘要: 转载 scrapy Post 发送数据是我们通常会用 yield scrapy.FormRequest( url = url, formdata = {"email" : "xxx", "password" : "xxxxx"}, callback = self.parse_page )来发送请求, 阅读全文
posted @ 2020-04-10 09:59 sunshine_5 阅读(520) 评论(0) 推荐(0) 编辑
摘要: mac python3.7消费kafka数据时报错如下: kafka.errors.UnsupportedCodecError: UnsupportedCodecError: Libraries for snappy compression codec not found 解决方案: 1. brew 阅读全文
posted @ 2020-04-02 14:11 sunshine_5 阅读(3615) 评论(0) 推荐(0) 编辑
摘要: docker ps -a --no-trunc 阅读全文
posted @ 2020-04-01 15:34 sunshine_5 阅读(1539) 评论(0) 推荐(0) 编辑
摘要: 使用freeze命令存在一个问题,生成的requirements.txt文件保存了当前Python环境下所有类库包,而pipreqs只包含当前项目下使用到的类库 使用方法: 1. pip3 install pipreqs 2.pipreqs . 安装所需类库内容执行pip3 install -r r 阅读全文
posted @ 2020-03-31 17:16 sunshine_5 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1、下载中文字体(黑体,看准系统版本) SimHei - Free Font Download​www.fontpalace.com 2、找到matplotlib字体文件夹,例如:matplotlib/mpl-data/fonts/ttf,将SimHei.ttf拷贝到ttf文件夹下面 3、修改配置文 阅读全文
posted @ 2020-03-31 15:23 sunshine_5 阅读(311) 评论(0) 推荐(0) 编辑