def extract_tabular(self, result={}, table_type="rows", header=[], prefix="", suffix="", selector="", attr="text", default="", verbosity=0):
		result_list = []
		if type(header) in [str, unicode]:
			try:
				header_list = self.tree.xpath(header)
				table_headers = [prefix + h.text + suffix for h in header_list]
			except XPathError:
				raise Exception("Invalid XPath selector " + header)
		else:
			table_headers = [prefix + h + suffix for h in header]
		if table_type not in ["rows", "columns"]:
			raise Exception("Specify 'rows' or 'columns' in table_type")
		if table_type == "rows":
			try:
				values = self.tree.xpath(selector)
				if len(table_headers) >= len(values):
					from itertools import izip_longest
					pairs = izip_longest(table_headers, values, fillvalue=default)
				else:
					from itertools import izip
					pairs = izip(table_headers, values)
				for head, val in pairs:
					if verbosity > 1:
						print("\nExtracting", head, "attribute", sep=' ', end='')
					if attr == "text":
						try:
							content = " ".join([make_ascii(x).strip() for x in val.itertext()])
						except Exception:
							content = default
						content = content.replace("\n", " ").strip()
					else:
						content = val.get(attr)
						if attr in ["href", "src"]:
							content = urljoin(self.url, content)
					result[head] = content
				result_list.append(result)
			except XPathError:
				raise Exception("Invalid XPath selector " + selector)
			except TypeError:
				raise Exception("Selector expression string to be provided. Got " + selector)
		else:
			try:
				if type(selector) in [str, unicode]:
					selectors = [selector]
				elif type(selector) == list:
					selectors = selector
				else:
					raise Exception("Use a list of selector expressions for the various columns")
				from itertools import izip, count
				pairs = izip(table_headers, selectors)
				columns = {}
				for head, selector in pairs:
					columns[head] = self.tree.xpath(selector)
				try:
					for i in count(start=0):
						r = result.copy()
						for head in columns.keys():
							if verbosity > 1:
								print("\nExtracting", head, "attribute", sep=' ', end='')
							col = columns[head][i]
							if attr == "text":
								try:
									content = " ".join([make_ascii(x).strip() for x in col.itertext()])
								except Exception:
									content = default
								content = content.replace("\n", " ").strip()
							else:
								content = col.get(attr)
								if attr in ["href", "src"]:
									content = urljoin(self.url, content)
							r[head] = content
						result_list.append(r)
				except IndexError:
					pass
			except XPathError:
				raise Exception("Invalid XPath selector " + selector)
			except TypeError:
				raise Exception("Selector expression string to be provided. Got " + selector)
		return table_headers, result_list
Hash the same as another FilePath with the same path as mine.
dataset/ETHPy150Open AlexMathew/scrapple/scrapple/selectors/xpath.py/XpathSelector.extract_tabular--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/python/filepath.py/AbstractFilePath.__hash__