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 Answers1

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?

jhylands
  • 984
  • 8
  • 16