I'm experimenting with automated competition entries using selenium. I've tried logging into gmail using the below code and it works fine. However, when trying on the website gleam the element does not appear to be the correct one (like it is hidden).
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
Here is the one for gmail:
browser = webdriver.Chrome('/Users/<MY_NAME>/Documents/Automate_Login_py/chromedriver')
browser.get(('https://accounts.google.com/ServiceLogin?''service=mail&continue=https://mail.google''.com/mail/#identifier'))
username = browser.find_element_by_id('Email')
username.send_keys('123@gmail.com')
This works no problem, but on gleam the element cannot be found:
browser = webdriver.Chrome('/Users/<MY_NAME>/Documents/Automate_Login_py/chromedriver')
browser.get(('https://gleam.io/contest/airpods-pro'))
browser.find_element_by_id('contestant[name]')
NoSuchElementException: Message: no such element: Unable to locate element
I've tried using Xpath and selector to no avail. There's also similar stack question here: Selenium Element is Not Visible Exception on Already Triggered Area that pretty much is the same problem. Hovever, the length of 4 mentioned in the answers is not the same for me as I am getting a length of 0.
I have also tried:
browser.implicitly_wait(30)
I am new to selenium so any guidance on dealing with these elements would be great.