@library.filter
def selector_content_find(document, selector):
 content = ''
 try:
  page = pq(document.rendered_html)
 except ValueError:
  pass
 try:
  content = page.find(selector).text()
 except SelectorSyntaxError:
  pass
 return content

@ library . filter def selector_content_find ( document , selector ) : content = '' try : page = pq ( document . rendered_html ) except ValueError : pass try : content = page . find ( selector ) . text ( ) except SelectorSyntaxError : pass return content
provided a selector .