Merge pull request #702 from a01200356/digbt
[fix] results with digbit don't truncate anymore
commitaaf5d506e51197603922d7b9d259c0f4e498f62b
authorAdam Tauber <asciimoo@gmail.com>
dateWed 21 Sep 2016, 10:36 (10 years ago)
parent8f48c51d1d4ed4
searx/engines/digbt.py+1−1
@@ -40,7 +40,7 @@ def response(resp):
4040 results = list()
4141 for result in search_res:
4242 url = urljoin(URL, result.xpath('.//a[@title]/@href')[0])
43− title = result.xpath('.//a[@title]/text()')[0]
43+ title = extract_text(result.xpath('.//a[@title]'))
4444 content = extract_text(result.xpath('.//div[@class="files"]'))
4545 files_data = extract_text(result.xpath('.//div[@class="tail"]')).split()
4646 filesize = get_torrent_size(files_data[FILESIZE], files_data[FILESIZE_MULTIPLIER])
tests/unit/engines/test_digbt.py+3−1
@@ -28,7 +28,9 @@ class TestDigBTEngine(SearxTestCase):
2828 <table class="table">
2929 <tr><td class="x-item">
3030 <div>
31− <a title="The Big Bang Theory" class="title" href="/The-Big-Bang-Theory-d2.html">The Big Bang Theory</a>
31+ <a title="The Big Bang Theory" class="title" href="/The-Big-Bang-Theory-d2.html">
32+ The Big <span class="highlight">Bang</span> Theory
33+ </a>
3234 <span class="ctime"><span style="color:red;">4 hours ago</span></span>
3335 </div>
3436 <div class="files">