title: webscraping multiple pages using python
body: <p>I have a problem scraping <a href="https://www.kenyaplex.com/schools/?start=1&amp;SchoolType=private-secondary-schools" rel="nofollow noreferrer">the webpage</a>  </p>
  
  <p>The url increases by 30 starting at 1. It contains many pages with lists of secondary schools in Kenya. Every page has a list of 30 schools. I want to scrape all the data with the following code, but it only gives content of one page which is 30 schools. I have string formated the url but still returning data for one page. My code:</p>
  
  <pre><code>#IMPORTING RELEVANT PACKAGES FOR THE WORK
  import requests
  from bs4 import BeautifulSoup
  import time
  
  #DEFINING THE FIRST WEBPAGE
  num = 1
  #STRING FORMATTING THE URL TO CAPTURE DIFFRENT PAGES
  url = 'https://www.kenyaplex.com/schools/?start={}&amp;SchoolType=private-secondary-schools'.format(num)
  #DEIFING THE BROWSER HEADERS SO THAT CAN WORK ON IT WITHOUT ERRORS
  headers = {'User-Agent':'Mozilla'}
  #GOING THROUGH ALL THE PAGES AND THE LINKS
  while num &lt; 452:
      url = 'https://www.kenyaplex.com/schools/?start={}&amp;SchoolType=private-secondary-schools'.format(num)
      time.sleep(1)
      num += 30
      response = requests.get(url,headers)
      soup = BeautifulSoup(response.text,'html.parser')
      school_info = soup.find_all('div', attrs={'class':'c-detail'})
  #EXTRACTING SPECIFIC RECORDS    
  records = []
  for name in school_info:
      Name_of_The_School = name.find('a').text
      Location_of_The_School = name.contents[2][2:]
      Contact_of_The_School = name.contents[4]
      Information_Link = name.find('a')['href']
  #converting the records to a tuple
         records.append((Name_of_The_School,
                         Location_of_The_School,
                         Contact_of_The_School,
                         Information_Link))
  #EXPORTING TO A PANDAS FILE    
  import pandas as pd
  df = pd.DataFrame(records, columns = ['Name of The School',
                                        'Location of The School',
                                        'Contact of The School',
                                        'Information_Link'])
  df.to_csv('PRIVATE_SECONDARY.csv', index = False, encoding = 'utf-8')
  </code></pre>