title: Iteration Problem Facebook Bot / Transforming text file lines into an array
body: <p>I'm trying to make a bot for Facebook. I have to log in to facebook with a username and password (found in identifiants.txt). After, I do actions on facebook, I log out and I have to log in again with other username and password. 
  Each line corresponds to a username and the next line corresponds to a password. So the next line is still a username. What I've tried to do is to transform the text file into a table of usernames. So the usernames have an odd box and the passwords have an even box. So here's what I tried to do:</p>
  
  <pre><code>nombre_listeux = 2
  
  class Facebook(scrapy.Spider):
  
  def __init__(self):
      self.driver = webdriver
      self.url = 'https://www.facebook.com/'
      webdriver.maximize_window()
  
  def login(self,nombre_listeux):
  
      f=open("/Users/anthonyjacquelin/Desktop/Dev Projects/Bot Insta /Facebook Bot/identifiants.txt","r")
  
      for i in range(0,nombre_listeux):
          self.driver.get(self.url)
          lines=f.readlines()
          print(i)
          username=lines[2*i]
          password=lines[2*i+1]
          print(username)
          print(password)
          user = self.driver.find_element_by_xpath("//input[@name=\"email\"]")
          user.send_keys(username)
          pwd = self.driver.find_element_by_xpath("//input[@name=\"pass\"]")
          pwd.send_keys(password)
          sleep(medium_time)
          Facebook_Bot.change_pic(nombre_listeux)
          Facebook_Bot.log_out()
  
      f.close()
  </code></pre>
  
  <p>The program works for the first pair of identifiers and for i=0, but when i=1, this is what the program returns: </p>
  
  <pre><code>Traceback (most recent call last):
  File "/Users/anthonyjacquelin/Desktop/Dev Projects/Bot Insta /Facebook Bot/facebook.py", line 68, in &lt;module&gt;
  Facebook_Bot.login(nombre_listeux)
  File "/Users/anthonyjacquelin/Desktop/Dev Projects/Bot Insta /Facebook Bot/facebook.py", line 29, in login
  username=lines[2*i]
  IndexError: list index out of range
  </code></pre>
  
  <p>Identifiants.txt is also like that :</p>
  
  <pre><code>dermacareprofr@gmail.com
  password1
  legrandpatrick410@gmail.com
  password2
  </code></pre>
  
  <p>It would be awesome if you could help me, thanks !  </p>