Improvement to retrieve WebElement attributes