I am doing php parser using cURL (simple_html_dom.php).
I have to parse news posts here: https://www.sport-express.ru/football/reviews/page2/
It is second page. I need to get programatically last number of page (it will be 50).
There is no pagination – only lazy loading button.
How can I get last page number using cURL?
Thanks!
PS: It will be great if You show also how can I get last page number when there will pagination.
2
Answers
A possible solution would be to go through all pages until the error 404 appears
Try this:
This is what we are looking for:
First find the position of ‘data-prop-max-page=’
The add 20 because the search string is 20 characters long.
Then get the the position of the
>
immediately following the $start position (third strpos parameter).Then get the sub string which today is 50.
Here are the values found:
Reply to my answer when that day comes. My psychic abilities are not that sharp.