@@ -42,7 +42,9 @@ def extract_text(xpath_results):
42 return ''.join(xpath_results)
42 return ''.join(xpath_results)
44 # it's a element
44 # it's a element
45− return html_to_text(xpath_results.text_content()).strip()
45+ text = html.tostring(xpath_results, encoding='unicode', method='text', with_tail=False)
46+ text = text.strip().replace('\n', ' ')
47+ return ' '.join(text.split())
48def extract_url(xpath_results, search_url):
50def extract_url(xpath_results, search_url):