title: Selenium TypeError: 'WebElement' object is not callable
body: <p>I'm trying to automate giftcard input on amazon, and I made this code</p>
  <pre><code>    from selenium import webdriver
      from selenium.webdriver.common.keys import Keys
      from webdriver_manager.chrome import ChromeDriverManager
      from selenium.webdriver.support.wait import WebDriverWait
      import time
      
      options = webdriver.ChromeOptions()
      options.add_argument(&quot;--incognito&quot;)
      driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)
      
      driver.get(&quot;https://www.amazon.com/ap/signin?clientContext=131-4641921-7497613&amp;openid.return_to=https%3A%2F%2Fwww.amazon.com%2Fgc%2Fredeem%2F&amp;openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&amp;openid.assoc_handle=amzn_gcfront_v2_us&amp;openid.mode=checkid_setup&amp;marketPlaceId=ATVPDKIKX0DER&amp;openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&amp;pageId=amzn_gcfront_v2_us&amp;openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&amp;openid.pape.max_auth_age=3600&amp;siteState=clientContext%3D144-1807701-9645427%2CsourceUrl%3Dhttps%253A%252F%252Fwww.amazon.com%252Fgc%252Fredeem%252F%2Csignature%3DduV3UfJbYbHeREFcPDmzxQt6fpIj3D&quot;)
      usr = driver.find_element_by_id(&quot;ap_email&quot;)
      usr.clear()
      usr.send_keys(&quot;username/email&quot;)
      pwd = driver.find_element_by_id(&quot;ap_password&quot;)
      pwd.clear()
      pwd.send_keys(&quot;pass&quot;)
      pwd.submit()
      
      #after email confirmation
  
      element = WebDriverWait(driver, 60).until(driver.find_element_by_id(&quot;ap_password&quot;))
      pwd = driver.find_element_by_id(&quot;ap_password&quot;)
      pwd.clear()
      pwd.send_keys(&quot;pass&quot;)
      pwd.submit()
      
      for i in range(1000):
          driver.get(&quot;https://www.amazon.com/gc/redeem/&quot;)
          elem = driver.find_element_by_id(&quot;gc-redemption-input&quot;)
          elem.clear()
          code_file = open(&quot;file directory&quot;, &quot;r&quot;)
          code = code_file.readlines()
          code_file.close()
          elem.send_keys(code[i])
          elem.submit()
  </code></pre>
  <p>but I got this error :</p>
  <pre><code>Traceback (most recent call last):
    File &quot;AutoSubmitGiftcardAmazon.py&quot;, line 20, in &lt;module&gt;
      element = WebDriverWait(driver, 60).until(driver.find_element_by_id(&quot;ap_password&quot;))
    File &quot;/usr/lib/python3/dist-packages/selenium/webdriver/support/wait.py&quot;, line 77, in until
      value = method(self._driver)
  TypeError: 'WebElement' object is not callable
  </code></pre>
  <p>I want this code to wait for me to confirm my email and then fill the password automatically<br />
  pls help</p>
  <p>Edit :<br />
  I changed the</p>
  <pre><code>element = WebDriverWait(driver, 60).until(driver.find_element_by_id(&quot;ap_password&quot;))
  </code></pre>
  <p>to</p>
  <pre><code>element = WebDriverWait(driver, 60).until(ec.presence_of_element_located(By.ID, &quot;ap_password&quot;))
  </code></pre>
  <p>and I've imported</p>
  <pre><code>from selenium.webdriver.common.by import By
  import selenium.webdriver.support.expected_conditions as ec
  </code></pre>
  <p>and I got this error :</p>
  <pre><code>Traceback (most recent call last):
    File &quot;AutoSubmitGiftcardAmazon.py&quot;, line 22, in &lt;module&gt;
      element = WebDriverWait(driver, 60).until(ec.presence_of_element_located(By.ID, &quot;ap_password&quot;))
  TypeError: __init__() takes 2 positional arguments but 3 were given
  </code></pre>
  <p>I'm a beginner, pls help me</p>