Python Selenium Explicit WebDriverWait function only works with presence_of_element_located
<p>I am trying to use Selenium WebDriverWait in Python to wait for items to load on a webpage , however, using any expected condition apart from <strong>presence_of_element_located</strong> seems to result in the error </p>

<blockquote>
  <p>selenium.common.exceptions.WebDriverException: Message: SyntaxError: missing ) in parenthetical</p>
</blockquote>

<p>I thought it might be linked to the site I was trying against , however I get the same error on any site - see snippit below where I have replaced <strong>presence_of_element_located</strong> with <strong>visibility_of_element_located</strong> and am trying to confirm visibility of the search box on python.org.</p>

<pre><code>from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
driver.get("http://www.python.org")

try:
    element = WebDriverWait(driver, 5).until(EC.visibility_of_element_located((By.NAME,"q")))
    element.send_keys("pycon")
    element.send_keys(Keys.RETURN)
finally:
    driver.quit()
</code></pre>

<p>The Full stack trace is as below , Any help would be appreciated !</p>

<pre><code>Traceback (most recent call last):
  File "C:\dev\test.py", line 51, in &lt;module&gt;
    element = WebDriverWait(driver, 5).until(EC.visibility_of_element_located((By.NAME,"q")))
  File "C:\Development\python\python35-32\lib\site-packages\selenium-3.0.0b3-py3.5.egg\selenium\webdriver\support\wait.py", line 71, in until
    value = method(self._driver)
  File "C:\Development\python\python35-32\lib\site-packages\selenium-3.0.0b3-py3.5.egg\selenium\webdriver\support\expected_conditions.py", line 78, in __call__
    return _element_if_visible(_find_element(driver, self.locator))
  File "C:\Development\python\python35-32\lib\site-packages\selenium-3.0.0b3-py3.5.egg\selenium\webdriver\support\expected_conditions.py", line 98, in _element_if_visible
    return element if element.is_displayed() == visibility else False
  File "C:\Development\python\python35-32\lib\site-packages\selenium-3.0.0b3-py3.5.egg\selenium\webdriver\remote\webelement.py", line 353, in is_displayed
    self)
  File "C:\Development\python\python35-32\lib\site-packages\selenium-3.0.0b3-py3.5.egg\selenium\webdriver\remote\webdriver.py", line 465, in execute_script
    'args': converted_args})['value']
  File "C:\Development\python\python35-32\lib\site-packages\selenium-3.0.0b3-py3.5.egg\selenium\webdriver\remote\webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "C:\Development\python\python35-32\lib\site-packages\selenium-3.0.0b3-py3.5.egg\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: SyntaxError: missing ) in parenthetical
</code></pre>

<p><em>Update - > After a few comments below i have done some testing on versions and browsers and this issue seems isolated to Python 3 and Firefox , the script works with Python 2.7 and works on both versions of python for Chrome webdriver .</em> </p>

<p>Copy pasted the same code and it works. 
Dint have enough repo to post comments so had to put it in answer section.</p>

python selenium