diff options
-rw-r--r-- | bs4/element.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bs4/element.py b/bs4/element.py index b100d18..9284d11 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -1753,3 +1753,8 @@ class ResultSet(list): def __init__(self, source, result=()): super(ResultSet, self).__init__(result) self.source = source + + def __getattr__(self, key): + raise AttributeError( + "ResultSet object has no attribute '%s'. You're probably treating a list of items like a single item. Did you call find_all() when you meant to call find()?" % key + ) |