title: Beautifulsoup scraping undetermined amount of numbered pages
body: <p>I’m scraping a site and iterating the numbered pages from the url, this is the code I am using:</p>
  <pre><code>base_url = '' #url of the site I’m scraping, only difference is page number at the end. 
  pages = list(map(str,range(1,4))) #change range for how many pages exist 
  url = base_url + pages[0]
  </code></pre>
  <p>It worked great for what I was doing, but I made an array of different users on the site that is functional but they all have different ending page numbers. The website itself when scraped will continue until the range is met even if there isn’t content past a certain page number. Is there a way for it to be able to stop when there isn’t content for that user so it can go to the next user in the array automatically?</p>