'''Mozilla/5.0 (Linux; U; Android 1.0; en-us; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2'''
The error message you are seeing is because you are trying to get the length of a WebElement object. You can’t do that. You need to get the text of the WebElement object first and then get its length. Here’s an example of how you can get the text of a WebElement object: WARNING: This is code. element = driver.find_element_by_xpath('xpath') text = element.text Then you can get the length of the text: WARNING: This is code length = len(text)