def extract_content(self, selector, attr, default):
		try:
			if selector == "url":
				return self.url
			if attr == "text":
				tag = self.tree.xpath(selector)[0]
				content = " ".join([make_ascii(x).strip() for x in tag.itertext()])
				content = content.replace("\n", " ").strip()
			else:
				content = self.tree.xpath(selector)[0].get(attr)
				if attr in ["href", "src"]:
					content = urljoin(self.url, content)
			return content
		except IndexError:
			if default is not "":
				return default
			raise Exception("There is no content for the selector " + selector)
		except XPathError:
			raise Exception("Invalid XPath selector " + selector)
Hook up the moderation methods to pre- and post-save signals
dataset/ETHPy150Open AlexMathew/scrapple/scrapple/selectors/xpath.py/XpathSelector.extract_content--crossover with--dataset/ETHPy150Open jezdez-archive/django-comment-utils/comment_utils/moderation.py/Moderator.connect