def calculate_pagination(self, url):
pages_count = 0
page = 1
status = 1
while status == 1:
response = requests.get(url.format(page))
page += 1
pages_count += 1
for resp in response.history:
if resp.status_code == 302:
status = 0
pages_count -= 1
print(f'Обнаружено страниц: {pages_count}')
return pages_count
https://www.ss.com/ru/work/are-required/today/page1.html
https://www.ss.com/ru/work/are-required/today/page2.html
https://www.ss.com/ru/work/are-required/today/page3.html
https://www.ss.com/ru/work/are-required/today/page4.html
https://www.ss.com/ru/work/are-required/today/page5.html
https://www.ss.com/ru/work/are-required/today/page6.html
https://www.ss.com/ru/work/are-required/today/page7.html
https://www.ss.com/ru/work/are-required/today/page8.html
https://www.ss.com/ru/work/are-required/today/page9.html
https://www.ss.com/ru/work/are-required/today/page10.html
https://www.ss.com/ru/work/are-required/today/page11.html
https://www.ss.com/ru/work/are-required/today/page12.html
https://www.ss.com/ru/work/are-required/today/page13.html
https://www.ss.com/ru/work/are-required/today/page14.html
https://www.ss.com/ru/work/are-required/today/page15.html
https://www.ss.com/ru/work/are-required/today/page16.html
https://www.ss.com/ru/work/are-required/today/page17.html
https://www.ss.com/ru/work/are-required/today/page18.html
https://www.ss.com/ru/work/are-required/today/page19.html
https://www.ss.com/ru/work/are-required/today/page20.html
https://www.ss.com/ru/work/are-required/today/page21.html
https://www.ss.com/ru/work/are-required/today/page22.html
https://www.ss.com/ru/work/are-required/today/page23.html
https://www.ss.com/ru/work/are-required/today/page24.html
https://www.ss.com/ru/work/are-required/today/
https://www.ss.com/ru/work/are-required/today/
https://www.ss.com/ru/work/are-required/today/
https://www.ss.com/ru/work/are-required/today/