beautifulsoup - Dynamically change range in Python? -


Then say I'm using pretty pages to parse the pages and my code tells that in a query the least There are at least 7 pages.

Feeling like paging

  1 2 3 4 5 6 7 Next  

If I paginate all the way from 7, Sometimes there are more than 7 pages, so if I am on page 7, then the number of page takes

  1 2 3 7 8 9 10 Next  

So now, I know there are at least 3 more pages. I am using an initial pass to find out how many pages that get_num_pages 7 returns

what I'm doing It's running on items on every page I have something like this

  Pages in category (1, num_pages + 1): # There are some things here  

Whether the script's data is dynamically There is a way to update with more than 7 page pages? I think there is another approach to keeping one count and as I go to page 7, handle it separately. I am looking for suggestions and solutions for the best way to contact this.

< / Div>

You can call a generator which has an unstable state that determines when it ends ... but about it Is such something simple?

  page = 1 while the page & lt; Num_pages + 1: # do a job that probably updates the newspage here Page + = 1  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -