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/
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/
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