summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-01 11:55:49 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-01 11:55:49 -0500
commit234e8eec133adc886161dbfa7cccc56fe59ed127 (patch)
tree6808f6bb1ebc2e7a9c814e301c994249c203de20 /bs4/element.py
parent82dabc7c76fb27898bfa864ecc8f8558949269c3 (diff)
Cleaned up the TODO.
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bs4/element.py b/bs4/element.py
index 75d5d9d..08a0181 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -1,6 +1,7 @@
import collections
import re
import sys
+import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
@@ -618,7 +619,12 @@ class Tag(PageElement):
def __getattr__(self, tag):
#print "Getattr %s.%s" % (self.__class__, tag)
if len(tag) > 3 and tag.endswith('Tag'):
- return self.find(tag[:-3])
+ # BS3: soup.aTag -> "soup.find("a")
+ tag_name = tag[:-3]
+ warnings.warn(
+ '.%sTag is deprecated, use .find("%s") instead.' % (
+ tag_name, tag_name))
+ return self.find(tag_name)
# We special case contents to avoid recursion.
elif not tag.startswith("__") and not tag=="contents":
return self.find(tag)