|
@@ -28,13 +28,13 @@ def extract_text(xpath_results):
|
28
|
28
|
result = ''
|
29
|
29
|
for e in xpath_results:
|
30
|
30
|
result = result + extract_text(e)
|
31
|
|
- return result
|
|
31
|
+ return result.strip()
|
32
|
32
|
elif type(xpath_results) in [_ElementStringResult, _ElementUnicodeResult]:
|
33
|
33
|
# it's a string
|
34
|
34
|
return ''.join(xpath_results)
|
35
|
35
|
else:
|
36
|
36
|
# it's a element
|
37
|
|
- return html_to_text(xpath_results.text_content())
|
|
37
|
+ return html_to_text(xpath_results.text_content()).strip()
|
38
|
38
|
|
39
|
39
|
|
40
|
40
|
def extract_url(xpath_results, search_url):
|