Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个覆盖 start_requests 函数来触发请求的蜘蛛。我的目标是触发 X 个请求并等待它们完成,然后再触发 X 个请求,直到不需要请求为止。
你建议我如何实现这样的目标?
我的想法是在 start_requests 中使用一个循环,从数据库中读取 X 个请求,然后使用 yield 来触发请求,直到数据库中没有可用的请求。
它会工作吗?