gevent+request+novel项目笔记

来源:互联网 发布:淘宝客自动转换工具 编辑:程序博客网 时间:2024/05/19 04:54
20161115
问题一:
描述: 在抓取回来所有的章节的链接后,虽然所有的链接都在,但是入库后还是有的章节没有,以及有的章节是重复的。
解决办法: 原来是使用Queue.get() 换成Queue.get_nowait() 就成了。
原因
get(block=True, timeout=None)    Remove and return an item from the queue.    If optional args block is true and timeout is None (the default), block if necessary until an item is available. If timeout is a positive number, it blocks at most timeout seconds and raises the Empty exception if no item was available within that time. Otherwise (block is false), return an item if one is immediately available, else raise the Empty exception (timeout is ignored in that case).get_nowait()    Remove and return an item from the queue without blocking.
0 0