0

I'm trying to extract the 'email' using selenium. I want to get the value="raipiwro@squizzy.net" directly from the box. How can i do this ?

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

how to get value="raipiwro@squizzy.net

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

2 Answers2

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

n.qber
  • 354
  • 2
  • 8
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
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352