2

Im currently on a project which fill the information automaticlly. There is a datepicker on the website which I cant click. How to trigger the datepicker to popup etc.

The website is payoneer.com / Login form

birthbutton = driver.find_elements_by_name("ctl00$cphBodyContent$PersonalDetails1$datepicker5")
birthbutton.click()

Just getting this everytime

AttributeError: 'list' object has no attribute 'click'

1 Answer 1

2

You have used find_elements_by_name() this will return list. You should use

find_element_by_name()

Now try this.

birthbutton = driver.find_element_by_name("ctl00$cphBodyContent$PersonalDetails1$datepicker5")
birthbutton.click()

I will suggests use webdriverwait.

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
driver=webdriver.Chrome()
driver.get("https://www.payoneer.com")
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.XPATH,"//div[@class='menu-user-menu-container']//ul//li/a[text()='Register']"))).click()
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.NAME,"ctl00$cphBodyContent$PersonalDetails1$datepicker5"))).click()

Browser Snapshot:

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

Thats the same thing I posted.
See my answer find_element_by_name not find_elements_by_name
@VRX : You have posted find_elements_by_name() not find_element_by_name() which I have suggested.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.