Reputation: 135
how to read next page of the same URL
the URL of the page contain many pages i read the first page using
URL(url).openStream()
but it just reading the first page
for example this site i read the first page how can i read the second culture.gov.uk/news/news_stories/6832.aspx
Upvotes: 0
Views: 1344
Reputation: 240860
Next page will have some link.
You can parse HTML and collect all the links and then you can filter out which is the next link for this page and then read it same way.
Here is the example that will list all the links from given page. - using JSOUP
Note: It is certainly ill-legal to do this for some sites.
Upvotes: 1