When I try to do code shown below I get error :
TypeError: 'str' object is not callable
email2_elem = driver.find_element_by_xpath("/html/body/div[1]/div[2]/div[1]/div[1]/div[1]/form[1]/div[1]/input[1]").text()
This error message...
TypeError: 'str' object is not callable
...implies that your program have invoked a function() which is actually a property.
As per selenium.webdriver.remote.webelement text is a property.
So, you can't invoke text() as a function. Hence you see the error.
You can use either of the following solutions:
Use text property:
email2_elem = driver.find_element_by_xpath("/html/body/div[1]/div[2]/div[1]/div[1]/div[1]/form[1]/div[1]/input[1]").text
Use get_attribute("innerHTML") method:
email2_elem = driver.find_element_by_xpath("/html/body/div[1]/div[2]/div[1]/div[1]/div[1]/form[1]/div[1]/input[1]").get_attribute("innerHTML")
get_attribute("innerHTML") is much more promising.Try this
find_element(By.XPATH, "class name")
Refer this documentation link
https://selenium-python.readthedocs.io/locating-elements.html#locating-elements