Add select_by_attr method as this is a common pattern