Selenium webdriverwait: __init__() takes exactly 2 arguments (3 given)
<p>gives the error as </p>

<pre><code>Traceback (most recent call last):
  File "p3.py", line 21, in &lt;module&gt;
    WebDriverWait(driver, timex).until(EC.presence_of_element_located(by, element))
TypeError: __init__() takes exactly 2 arguments (3 given)
</code></pre>

<p>I have not used <code>__init__()</code> why is this error there?</p>

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

chrome_path=r"C:\Users\Bhanwar\Desktop\New folder (2)\chromedriver.exe"
driver =webdriver.Chrome(chrome_path)
driver.get("https://priceraja.com/mobile/pricelist/samsung-mobile-price-list-in-india")
#driver.implicitly_wait(10)
i=0
timex = 5
by = By.ID
hook = "product-itmes-"  # The id of one item, they seems to be this plus 
                         # the number item that they are
button = '.loadmore'
while i&lt;3:
    element_number = 25*i
    element=hook+str(element_number)# It looks like there are 25 items added each time, and starts at 25
    WebDriverWait(driver, timex).until(EC.presence_of_element_located(by, element))
    driver.find_element_by_css_selector(button).click()
    time.sleep(5)  # Makes the page wait for the element to change
    i+=1
</code></pre>

<p><code>presence_of_element_located()</code> only takes one argument, a locator, which is a tuple. You forgot to add the <code>(...)</code> parentheses needed for a tuple in a call:</p>

<pre><code>WebDriverWait(driver, timex).until(
    EC.presence_of_element_located((by, element)))
#          these make this a tuple ^ and       ^
</code></pre>

python selenium selenium-chromedriver