title: Script can't find Element but Console can [Selenium] [Python]
body: <p>I'm trying to write script to automate the process of downloading the instagram stories but I'm failing already when trying to log in.</p>
  
  <p>I'm writing the code inside <code>Pycharm</code>. I just tried my usual approach to any problem. First, solve it with typing the commands out in the console and if it works writing the commands which worked inside the console down in a script. But here is the issue. The function which worked perfectly fine inside the <em>python console</em> fails inside the script. </p>
  
  <p>I've noticed that my <code>selenium</code> was outdated but upgrading it didn't help ether. I also made a new project to test weather that made difference, which it didn't.</p>
  
  <p>I've also tried skipping the first step inside the script and just opening the url to which I'm redirected. But the second commands failed as well. </p>
  
  <p>When I create a new variable to store the output of the <code>driver.find_element_by_link_text()</code> in, it returns an empty list. This leads me to belive that somehow selenium is unable to search the contetns of the page.</p>
  
  <p>I've also tried the same on Chrome and Safari. This also didn't work.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  driver = webdriver.Firefox()
  driver.get("https://instagram.com/")
  #next command fails
  driver.find_element_by_link_text("Melde dich an.").click()
  
  #if the first command is skipped by entering in the url 
  #in driver.get(https://www.instagram.com/accounts/login/?source=auth_switcher)
  #the following command fails as well.
  driver.find_element_by_name("username").send_keys("HereIsTheUsername")
  driver.find_element_by_name("password").send_keys("HereIsThePassword")
  driver.find_element_by_name("password").send_keys(Keys.RETURN)
  driver.close()
  </code></pre>
  
  <p>In the console these commands worked as mentioned,
  Here is what I've entered into the console:</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  driver = webdriver.Firefox()
  driver.get("https://instagram.com/")
  driver.find_element_by_link_text("Melde dich an.").click()
  #if it failed here would be an error message
  element = driver.find_element_by_name("username")
  </code></pre>
  
  <p>With the script the error message is this:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):   File
    "/Users/alisot2000/PycharmProjects/Instagram downloader/venv/Main.py",
    line 6, in 
        driver.find_element_by_link_text("Melde dich an.").click()   File "/Users/alisot2000/PycharmProjects/Instagram
    downloader/venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py",
    line 428, in find_element_by_link_text
        return self.find_element(by=By.LINK_TEXT, value=link_text)   File "/Users/alisot2000/PycharmProjects/Instagram
    downloader/venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py",
    line 978, in find_element
        'value': value})['value']   File "/Users/alisot2000/PycharmProjects/Instagram
    downloader/venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py",
    line 321, in execute
        self.error_handler.check_response(response)   File "/Users/alisot2000/PycharmProjects/Instagram
    downloader/venv/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py",
    line 242, in check_response
        raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: Unable to
    locate element: Melde dich an.</p>
  </blockquote>