[fix] results with digbit don't truncate anymore
commitd1d4ed4376e41fa380b5b3a72e1b08e1f36a35e8
authormarc <a01200356@itesm.mx>
dateTue 20 Sep 2016, 15:35 (10 years ago)
parent8f48c51
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">