code: def extract_columns(self, result={}, selector='', table_headers=[], attr='', connector='', default='', verbosity=0, *args, **kwargs):
  		
  		result_list = []
  
  		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.get_tree_tag(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 = connector.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 %s selector - %s" % (self.__selector_type__, selector))
  		except TypeError:
  			raise Exception("Selector expression string to be provided. Got " + selector)
  
  		return result_list
docs: Column data extraction for extract_tabular