serpapi-python icon indicating copy to clipboard operation
serpapi-python copied to clipboard

Enforce `‎SerpResults.yield_pages` to start from the first page

Open ilyazub opened this issue 2 years ago • 1 comments

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

https://github.com/serpapi/serpapi-python/blob/44e41d36723da1e95e4ac165c08b6c98e6a95027/serpapi/models.py#L74-L78

Let's yield current_page before entering the pagination loop.

@kennethreitz @jvmvik

ilyazub avatar Nov 17 '23 12:11 ilyazub

@ilyazub I tried to update the method in this PR https://github.com/serpapi/serpapi-python/pull/13 , as well as the test to be more precise.

hilmanski avatar Nov 23 '23 08:11 hilmanski