0

I'm trying to extract the 'email' using selenium. I want to get the value="[email protected]" directly from the box. How can i do this ?

Website link: https://www.squizzy.de/

how to get value="raipiwro@squizzy.net

2 Answers 2

1

Helloww, you're trying to get the attribute value of an element, so we should do that:

driver.find_element("tag name", 'input').get_attribute('value')

First we get the element, then, get it's value attribute which is the email

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

Comments

0

To extract the email address using Selenium you need to induce WebDriverWait for the visibility_of_element_located() and you can use either of the following Locator Strategies:

  • Using CSS_SELECTOR:

    print(WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "input[name='mail']"))).get_attribute("value"))
    
  • Using XPATH:

    print(WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//input[@name='mail']"))).get_attribute("value"))
    
  • Note : You have to add the following imports :

    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support import expected_conditions as EC
    

Comments

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.