【发布时间】:2012-02-07 13:04:58
【问题描述】:
我正在编写 python 来使用 Twitter-py 抓取 Twitter 空间。我已将爬虫设置为在对 api.twitter.com 的每个请求之间休眠一段时间(2 秒)。但是,在运行了一段时间后(大约 1 次),当 Twitter 的速率限制还没有超过时,我得到了这个错误。
[Errno 10054] An existing connection was forcibly closed by the remote host.
这个问题的可能原因是什么以及如何解决这个问题?
我搜索了一下,发现Twitter服务器本身可能会因为请求太多而强制关闭连接。
非常感谢您。
【问题讨论】:
标签: python twitter web-crawler