title: Selenium findElement(By by) equivalent in Python
body: <p>Using Selenium (Python), how do we pass the <code>By</code> object to findElement()?</p>
  
  <p><strong>Java</strong> (this works)</p>
  
  <pre><code>By locater = By.id("username")
  WebElement elem = driver.findElement(locater)
  elem.SendKeys("tester")
  </code></pre>
  
  <p><strong>Python</strong> (this fails)</p>
  
  <pre><code>locater = By.id("username")
  elem = driver.find_element(locater)
  elem.send_keys("tester")
  </code></pre>
  
  <p>Error i get in python is <code>'str' object is not callable</code>.
  I looked this up in other SO conversations and its because python expects something like By.ID or By.XPATH etc.</p>
  
  <p>I need a way to pass the By object and wondered it it is possible. Thanks in advance.</p>