title: Selenium won't open a new url in for loop (Python & Chrome)
body: <p>I can't seem to get Selenium to run this for loop correctly. It runs the first time without issue but when it starts the second loop to the program just stops running with no error message. I get the same results when I attempt this with a firefox browser. Maybe it has to do with me trying to start a browser instance when one is already running?</p>
  <pre><code>def bookroom(self):
  sessionrooms=[&quot;611&quot;, &quot;618&quot;] #the list being used by the for loop   
          driver = webdriver.Firefox() 
          #for loop trying each room
          for rooms in sessionrooms:
              room=roomoptions[rooms][0]
              sidenum=roomoptions[rooms][1]
              bookingurl=&quot;https://coparooms.newschool.edu/copa-scheduler/Web/reservation.php?rid=&quot;+room+&quot;&amp;sid=&quot;+sidenum+&quot;&amp;rd=&quot;+self.startdate
              driver.get(bookingurl)
              time.sleep(3)
              usernamefield = driver.find_element_by_id(&quot;email&quot;)
              usernamefield.send_keys(self.username)
              passwordfield = driver.find_element_by_id(&quot;password&quot;)
              passwordfield.send_keys(self.password)
              passwordfield.send_keys(Keys.RETURN)
              time.sleep(5)
              begin=Select(driver.find_element_by_name(&quot;beginPeriod&quot;))
              print(self.starttime)
              begin.select_by_visible_text(convertarmy(self.starttime))
              end=Select(driver.find_element_by_name(&quot;endPeriod&quot;))
              end.select_by_visible_text(convertarmy(self.endtime))
  creates=driver.find_element_by_xpath(&quot;//button[contains(.,'Create')]&quot;)
              creates.click() #clicks the confirm button
              time.sleep(8)
              xpathtest=driver.find_element_by_id(&quot;result&quot;).text
              #if statement checks if creation was a success. If it is, exit the browser.
              if &quot;success&quot; in xpathtest or &quot;Success&quot; in xpathtest:
                  print &quot;Success!&quot;
                  driver.exit()
              else:
                  print &quot;Failure&quot;
                  time.sleep(2)
              #if creation was not success try the next room in sessionrooms
  </code></pre>
  <p><strong>Update:</strong></p>
  <p>I found the problem, it was just a matter of uneven spacing. Only some of the loop was &quot;in the loop&quot;.</p>