![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python爬虫
海里的猴子
这个作者很懒,什么都没留下…
展开
-
《用Python写网络爬虫》第三章程序(link_crawler,downloader,MongoCache,scrape_callback,DiskCache)
整理link_crawler以及downloader书中的内容是用python2.7写的,自己整理了一下,用python3.6.3中可以运行downloader class Downloader: def __init__(self,delay=5,user_agent='wswp', proxies=None,num_retries=1,cache...原创 2019-04-10 14:01:13 · 447 阅读 · 0 评论 -
PyMongo 3.7.2 的基本用法
1.首先是下载安装MongoDB以及MongoDB CompassMongoDB的下载地址是:https://www.mongodb.com/download-center/community安装过程可以参考:http://www.runoob.com/mongodb/mongodb-window-install.html注:安装过程中提示安装MongoDB Compass,需要取消勾选,后...原创 2019-04-18 13:18:15 · 510 阅读 · 0 评论 -
《用Python写网络爬虫》第四章
import csvfrom zipfile import ZipFileimport iofrom io import StringIO在这里没有用到from Crawler_learn.lec03.downloader_leo import Downloaderdef alexa():################3测试单独打开csv文件 #csv_data = 'top...原创 2019-05-19 22:35:44 · 98 阅读 · 0 评论 -
python中的知识点
1.CSV文件的操作2.字符串与字节之间的关系原创 2019-05-19 22:45:12 · 59 阅读 · 0 评论 -
Error: iterator should return strings, not bytes (did you open the file in text mode?)
使用Zipfile读取压缩文件中的csv文件时,会出现标题中的错误。实际中添加io.TextIOWrapper指令即可。在官方手册中https://docs.python.org/3/library/zipfile.html?highlight=textiowrapper查询TestIOWrapper也能够查到。zipped_data='top-1m.csv.zip' urls...原创 2019-06-09 10:38:28 · 872 阅读 · 0 评论