Answer the question
In order to leave comments, you need to log in
JSOUP: How to count the number of pages on a website?
Good afternoon!
Guys, I'm parsing a site like this: www.myurl.com/page/X
X is the number of the page from which I should extract all the cards.
From one page, I can pull pictures. No problem.
But here's how to change the link in a cycle (page/1 ; page/2 ; page/3), and run my code on these pages?
The problem is that I don't know how many pages there are on the site and it can increase over time as new pictures are added.
What do you guys recommend? how to be?
Answer the question
In order to leave comments, you need to log in
The most important thing is to save the next page and / or retrieve it correctly.
But since there is no concrete example, there is no concrete answer.
Do the pictures run across the pages?
In such a simple scheme, we loop to 404 (or that the site responds to a non-existent page there) and remember the number to which they downloaded and the number of pictures on the last successful page. The next start is from the last page, from +1 picture. and again to 404.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question