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

Enforce ‎SerpResults.yield_pages to start from the first page #12

Open
ilyazub opened this issue Nov 17, 2023 · 1 comment · May be fixed by #13
Open

Enforce ‎SerpResults.yield_pages to start from the first page #12

ilyazub opened this issue Nov 17, 2023 · 1 comment · May be fixed by #13

Comments

@ilyazub
Copy link
Contributor

ilyazub commented Nov 17, 2023

Currently, ‎SerpResults.yield_pages skips the first page. Because of that, it's required to duplicate the results processing in the clients' code.

current_page = self
while current_page.next_page_url and current_page_count < max_pages:
current_page = current_page.next_page()
current_page_count += 1
yield current_page

Let's yield current_page before entering the pagination loop.

@kennethreitz @jvmvik

@hilmanski hilmanski linked a pull request Nov 23, 2023 that will close this issue
@hilmanski
Copy link
Contributor

@ilyazub I tried to update the method in this PR #13 , as well as the test to be more precise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants