gevent+request+novel项目笔记

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值