title: Clicking Next Page Using Selenium
body: <p>I have tried a number of ways, from xpath to link text to get Selenium to locate the "Next Page" button, and then click until the last page, but just couldn't get this to work. </p>
  
  <p>This is the error that I have using xpath:</p>
  
  <p>no such element: Unable to locate element: {"method":"xpath","selector":"//li[@class="next"]/a"}
    (Session info: chrome=79.0.3945.88)</p>
  
  <p>Code:</p>
  
  <pre><code>import requests, bs4, time, selenium  #import libraries
  from selenium import webdriver
  from selenium.webdriver.support.select import Select
  
  driver=webdriver.Chrome()
  driver.get('https://egov2.manchesternh.gov/Click2GovTX/accountsearch.html')
  
  select=Select(driver.find_element_by_id('searchMethod'))
  select.select_by_value('2')
  
  streetName=driver.find_element_by_id('addressName')
  time.sleep(1)
  streetName.clear()
  streetName.send_keys("A")
  streetName.send_keys(u'\ue007')
  
  url=driver.current_url
  print(url)
  driver.get(url)
  nxt=driver.find_element_by_xpath('//li[@class="next"]/a')
  nxt.click() 
  time.sleep(1)
  </code></pre>