title: How to add condition in while true
body: <p>here i just put some code to <strong>scrape</strong> some data from website and i want to take these data from all page so i make a loop while true: and there have 550 page but i want to <strong>scrape</strong> only 10 or 20 page so how i put condition to pull 10/20 or 100 page</p>
  <pre><code>import requests 
  from bs4 import BeautifulSoup
  import pandas as pd
  
  re=requests.get(&quot;https://katmoviehd.sk/&quot;)
  soup=BeautifulSoup(re.text,&quot;html.parser&quot;)
  
  
  while True:
         
      page = soup.find_all('h2')[1:]
      
      Category = soup.find_all('span', class_ = 'meta-category')
      Category
      
      Category_list = []
      
      for i in Category:
          Category2 = i.text
          Category_list.append(Category2)
      
      link_list = []
      
      for i in page:
          link = (i.find(&quot;a&quot;)['href'])
          link_list.append(link)
          
          
          
      title_list = []    
      
      for i in page:
          title = (i.find(&quot;a&quot;)['title'])
          title_list.append(title)
          
          
      Table = pd.DataFrame({'Links':link_list, 'Title':title_list, 'Category':Category_list})
     
      next_page = soup.find('a', class_ = 'next page-numbers').get('href')
      next_page
      
      url = next_page
      
      page = requests.get(url)
      soup = BeautifulSoup(page.text, 'lxml')
  </code></pre>