
python
XY_Noire
咸鱼学生
展开
-
python requests 基础资料
python requests 基础资料import requestsresponse = requests.get('http://www.baidu.com')response.encoding='utf-8'print('状态码:',response.status_code) # 打印状态码print('url:', response.url) # 打印请求u...转载 2019-03-09 14:25:36 · 526 阅读 · 0 评论 -
python字符串带运算符拼接报错
拼接字符串 sql="a"+"b > c"TypeError: bad operand type for unary +: 'str'解决方法sql=("a"+"b > c")...记一下踩到的少见的坑...原创 2019-07-27 21:13:05 · 883 阅读 · 0 评论 -
使用Elasticsearch实现一个简单的小说网站搜索功能
数据源:Mysql中存放的网络爬取的小说信息。选取其中的 id,名字,作者,介绍 字段存到es中。从mysql中其取出数据,转成 字典(json)形式,再使用 es 的 bulk批量提交。bulk 分 Elasticsearch.bulk 和 from elasticsearch.helpers import bulk,参数有点差异后者的返回结果为提交结果 成功数,失败数/错误列...原创 2019-08-18 18:49:16 · 2610 阅读 · 2 评论