title: Get Instagram followers list with python script
body: <p>I'm beginner in python programming and i want to export my Instagram followers and following list into an excel file. Searching on Google i found this <a href="https://stackoverflow.com/questions/55264169/get-instagram-followers-list-with-python">post</a>. I will paste the code bellow:</p>
  <pre><code># Get instance
  import instaloader
  L = instaloader.Instaloader()
  
  # Login or load session
  L.login(username, password)        # (login)
  
  
  # Obtain profile metadata
  profile = instaloader.Profile.from_username(L.context, &quot;prada&quot;)
  
  # Print list of followees
  follow_list = []
  count=0
  for followee in profile.get_followers():
      follow_list.append(followee.username)
      file = open(&quot;prada_followers.txt&quot;,&quot;a+&quot;)
      file.write(follow_list[count])
      file.write(&quot;\n&quot;)
      file.close()
      print(follow_list[count])
      count=count+1
  # (likewise with profile.get_followers())
  </code></pre>
  <p>All i edited was the username and the password from &quot;Login or load session&quot; section and &quot;prada&quot; from &quot;Obtain profile metadata&quot; section. So my code is looking like this:</p>
  <pre><code># Login or load session
  L.login(&quot;myusername&quot;, &quot;mypassword&quot;)        # (login)
  
  
  # Obtain profile metadata
  profile = instaloader.Profile.from_username(L.context, &quot;myusername&quot;)
  </code></pre>
  <p>Although I reset the password I still get the following error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;D:/ ..... /insta_followers.py&quot;, line 6, in &lt;module&gt;
      L.login(&quot;myusername&quot;, &quot;mypassword&quot;)        # (login)
    File &quot;C:\Users\Myuser\AppData\Local\Programs\Python\Python38-32\lib\site-packages\instaloader\instaloader.py&quot;, line 483, in login
      self.context.login(user, passwd)
    File &quot;C:\Users\Myuser\AppData\Local\Programs\Python\Python38-32\lib\site-packages\instaloader\instaloadercontext.py&quot;, line 254, in login
      raise BadCredentialsException('Login error: Wrong password.')
  instaloader.exceptions.BadCredentialsException: Login error: Wrong password.
  </code></pre>
  <p>I'm 100% the password is working because i tested in browser. My password contains uppercase and lowercase letters, numbers and signs. It is possible to get this error because one of the characters from the password? Or maybe because i recently reset the password? Can you give me some advice please?</p>
  <p>I'm using PyCharm Community 2020.2 and Python 3.8.</p>
  <p>Thank you</p>
  <p>L.E.</p>
  <p>My final code is looking like this:</p>
  <pre><code># Get instance
  import instaloader
  
  L = instaloader.Instaloader()
  
  # Login or load session
  username = &quot;myusername&quot;
  password = &quot;mypassword&quot;
  L.login(username, password)  # (login)
  
  # Obtain profile metadata
  profile = instaloader.Profile.from_username(L.context, username)
  
  # Print list of followees
  follow_list = []
  count = 0
  for followee in profile.get_followers():
      follow_list.append(followee.username)
      file = open(&quot;prada_followers.txt&quot;, &quot;a+&quot;)
      file.write(follow_list[count])
      file.write(&quot;\n&quot;)
      file.close()
      print(follow_list[count])
      count = count + 1
  # (likewise with profile.get_followers())
  </code></pre>