![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
爬虫
文章平均质量分 83
汴水流
这个作者很懒,什么都没留下…
展开
-
python的编码问题总结
计算机只能识别0,1;ASCII编码中 默认最大8bit (1111111即最大255);远不够老美以外其他国家的使用;中国添加了GB2312,其他国家也设计了自己的编码格式;于是各有自己标准就造成了混乱局面,Unicode诞生;Unicode(16bit 还是32bit不确定,总之足够大了),可以满足各个国家语言加起来使用。弊端就是unicode编码占用存储空间更大了,不过有一点好处,一样的长...原创 2018-04-29 10:23:49 · 209 阅读 · 0 评论 -
scrapy之pipelines存数据库Mysql(一)
scrapy爬取成功后可以保存在本地或者数据库,保存的格式也是多样的。可参考官方文档https://docs.scrapy.org/en/latest/topics/item-pipeline.html#writing-your-own-item-pipeline本文总结保存mysql首先,setting.py文件配置ITEM_PIPELINES = { xxxxx 'Article...原创 2018-05-06 15:50:25 · 1417 阅读 · 1 评论 -
scrapy安装和环境准备
相关文档链接: http://scrapy-chs.readthedocs.io/zh_CN/0.24/intro/install.html#intro-install版本选择https://github.com/rmax/scrapy-redis#requirements 由于分布式爬虫用到了scrapy-redis,它对于版本的要求如下(当然 随着更新会支持更新版本的python) Requi...原创 2018-04-29 14:46:09 · 571 阅读 · 0 评论 -
tornado实现并发爬虫
示例代码 from urllib.parse import urljoin from bs4 import BeautifulSoup from tornado import gen, httpclient, ioloop, queues base_url = "http://www.tornadoweb.org/en/stable/" concurrency = 3 async def...转载 2019-06-20 20:39:10 · 529 阅读 · 0 评论