1

I'm trying to login into "aminoapps.com" but unable to select login by email..So far I've only managed to get it to open the popup using the login button on the main page.

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

class AminoBot():
    def __init__(self,email,password):
        self.browser = webdriver.Firefox()
        self.email = email
        self.password = password


    def signIn(self):
        self.browser.get("https://aminoapps.com/")


        self.browser.find_element_by_xpath("/html/body/header/div/div/nav/ul/li[3]/a").click()
#        self.browser.find_element_by_css_selector("signin-email").click()
        try:
            element = WebDriverWait(self.browser, 100)
            self.browser.find_element_by_xpath("/html/body/div[2]/div[2]/div/div/div[2]/div[1]/div[1]/button[2]").click()
            emailInput = self.browser.find_element_by_xpath("/html/body/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/form/div[1]/")
            passwordInput = self.browser.find_element_by_xpath("/html/body/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/form/")
            emailInput.send_keys(self.email)
            passwordInput.send_keys(self.password)
            passwordInput.send_keys(Keys.ENTER)
            time.sleep(2)


        finally:
            webdriver.quit()



bot = AminoBot('justlogin@xyz.com','ABCDEFGH')
bot.signIn()

So far i've tried the following, to no avail..

Guy
  • 34,831
  • 9
  • 31
  • 66
KABOOM
  • 33
  • 8

1 Answers1

1

To click on the element with text as Sign in with email you have to induce WebDriverWait for the element_to_be_clickable() and you can use the following Locator Strategies:

  • xpath:

    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.get('https://aminoapps.com/')
    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//a[@class='nav-link block pointer' and @data-popup='login']"))).click()
    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@class='login-area']//button[@class='auth-btn signin-email']/i[@class='fa fa-envelope']"))).click()
    
  • Browser Snapshot:

amino

DebanjanB
  • 118,661
  • 30
  • 168
  • 217