You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To handle pagination for this site, first of we will load the index page and extract the number of products. We have already observed that 8 products are loaded in one request. Now we can calculate the number of pages as following
225
+
To handle pagination for this site, first of we will load the index page and extract the number of products. We have already observed that 8 products are loaded in one request. Now we can calculate the number of pages as follows:
226
226
227
227
Number of pages = 132/8 =16.5
228
228
@@ -253,7 +253,7 @@ for page_numer in range(2, page_count+1):
253
253
254
254
## Pagination with Load More Button
255
255
256
-
The way the pagination using a Load More button works is very similar to how infinite scroll works. The only difference is how loading the next page is triggered on browser.
256
+
The way the pagination using a Load More button works is very similar to how infinite scroll works. The only difference is how loading the next page is triggered on the browser.
257
257
258
258
As we are working directly with the web page without a browser, these two scenarios need to be handled the same way.
259
259
@@ -263,7 +263,7 @@ You will see that the response is in JSON format with an attribute `remaining`.
263
263
264
264
- Each request gets 12 results
265
265
- The value of remaining decreases by 12 with every click of Load More
266
-
- If we set the value page to 1 in the api url, it get's the first page of the results - `https://smarthistory.org/wp-json/smthstapi/v1/objects?tag=938&page=1`
266
+
- If we set the value page to 1 in the API url, it get's the first page of the results - `https://smarthistory.org/wp-json/smthstapi/v1/objects?tag=938&page=1`
0 commit comments