title: Cycle trough URLs from a txt
body: <p>This is my first question so please bear with me (I have googled this and I did not find anything)</p>
  
  <p>I'm making a program which goes to a url, clicks a button, checks if the page gets forwarded and if it does saves that url to a file.</p>
  
  <p>So far I've got the first two steps done but I'm having some issues.</p>
  
  <p>I want Selenium to repeat this process with multiple urls (if possible, multiple at a time).
  I have all the urls in a txt called <code>output.txt</code> </p>
  
  <p>At first I did</p>
  
  <pre><code>url_list = https://example.com
  </code></pre>
  
  <p>to see if my program even worked, and it did however I am stuck on how to get it to go to the next URL in the list and I am unable to find anything on the internet which helps me.</p>
  
  <p>This is my code so far</p>
  
  <pre><code>import selenium
  from selenium import webdriver
  
  url_list = "C\\user\\python\\output.txt"
  
  def site():
      driver = webdriver.Chrome("C:\\python\\chromedriver")
      driver.get(url_list)
      send = driver.find_element_by_id("NextButton")
      send.click()
  
      if (driver.find_elements_by_css_selector("a[class='Error']")):
          print("Error class found")
  </code></pre>
  
  <p>I have no idea as to how I'd get selenium to go to the first url in the list then go onto the second one and so forth. 
  If anyone would be able to help me I'd be very grateful.</p>