0

When I use the inspector tool, It says that the element is an input box. I am not sure how to work around it as I'm very inexperienced with python

from selenium import selenium webdriver

Emailsite = webdriver.Chrome(Folder + '\chromedriver.exe')
Emailsite.get('https://10minutemail.com/')
time.sleep(2)
print(Emailsite.find_element_by_id('mail_address').text)

The output is an empty string despite the website displaying an email for me to use.

1 Answer 1

2

The email address is stored in the value of the input field.

print(Emailsite.find_element_by_id('mail_address').get_attribute('value'))

As per How to get attribute of element from Selenium?

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

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.