Login confirm on dropbox

46 Views Asked by At

Still on dropbox (https://www.dropbox.com/login),once I inserted the email in the login box (working), trying to click the forward button doesn't work by simply "clicking" the xpath: '/html/body/div[2]/div[2]/div/div/div/div/div/div/div/div[2]/form/div[2]/div/button'.

Wonder if there is some iframe issue in there but couldn't manage to find it. Any help?

1

There are 1 best solutions below

0
Obaskly On

There is no iframe. I grabbed the full xpath and it was slightly different from yours.

/html/body/div[1]/div[2]/div/div/div/div/div/div/div/div[2]/form/div[2]/div/button

I tried this and the continue button is clicking fine

import time
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.dropbox.com/login')

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '/html/body/div[1]/div[2]/div/div/div/div/div/div/div/div[2]/form/div[1]/div[1]/input[1]'))).send_keys('[email protected]')

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '/html/body/div[1]/div[2]/div/div/div/div/div/div/div/div[2]/form/div[2]/div/button'))).click()

time.sleep(20)

Or you can do it with css_selector:

import time
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.dropbox.com/login')

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '/html/body/div[1]/div[2]/div/div/div/div/div/div/div/div[2]/form/div[1]/div[1]/input[1]'))).send_keys('[email protected]')

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "button[type='submit']"))).click()

time.sleep(20)