Sep-02-2019, 12:15 PM
(Sep-02-2019, 10:52 AM)buran Wrote: you need to retrieve the num_pages before being able to use it.
Could i ask you for some additional help? I got stucked :( i would appreciate any help
How it come that i cant get num_pages from it?
#pagination- find max pages page1 = soup.find('ul', {'class': 'pagination'}) pages = page1.find_all('li') last_page = pages[-3] num_pages = last_page.find('a').text #print(num_pages) for n in range(1, num_pages): page = 'https://www.pararius.com/apartments/amsterdam/page-1' + n print(num_pages)it returns me: TypeError: 'str' object cannot be interpreted as an integer
so i tried to change it to int but didn't work.
I guess i have to make a function that returns me num_pages and then i could call it? It would be my first function :P can i get an assist?