Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to limit the Zyte API requests #111

Closed
BurnzZ opened this issue Jul 14, 2023 · 4 comments
Closed

A way to limit the Zyte API requests #111

BurnzZ opened this issue Jul 14, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@BurnzZ
Copy link
Member

BurnzZ commented Jul 14, 2023

I'm thinking of a feature where the user can indicate the max number of Zyte API requests for a given spider crawl. When this number is reached, the spider shuts down.

The main use case for this is to limit the costs per crawl.

@BurnzZ BurnzZ added the enhancement New feature or request label Jul 14, 2023
@Gallaecio
Copy link
Contributor

Wouldn’t CLOSESPIDER_PAGECOUNT do the job in most cases?

@BurnzZ
Copy link
Member Author

BurnzZ commented Jul 17, 2023

Yes, that's right. But it would also include non-ZAPI requests to the count.

EDIT: I also realized that CLOSESPIDER_PAGECOUNT doesn't guarantee that the number of requests won't stop at that point. Any remaining requests in the queue/engine would still be executed.

@BurnzZ
Copy link
Member Author

BurnzZ commented Jul 19, 2023

An alternative: https://github.com/croqaz/scrapy-count-filter

Though it still doesn't address the issue of directly limiting the number of ZAPI requests.

@BurnzZ
Copy link
Member Author

BurnzZ commented Aug 4, 2023

Closing as #114 has been merged

@BurnzZ BurnzZ closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants