Bläddra i källkod

Merge pull request #780 from kvch/google-play-movies-fix

XPATH engines: Google Play Music, Habrahabr, Yandex
Adam Tauber 8 år sedan
förälder
incheckning
75c58fd008
2 ändrade filer med 7 tillägg och 6 borttagningar
  1. 2
    2
      searx/engines/yandex.py
  2. 5
    4
      searx/settings.yml

+ 2
- 2
searx/engines/yandex.py Visa fil

@@ -29,10 +29,10 @@ language_map = {'ru': 'ru',
29 29
 base_url = 'https://yandex.{tld}/'
30 30
 search_url = 'search/?{query}&p={page}'
31 31
 
32
-results_xpath = '//div[@class="serp-item serp-item_plain_yes clearfix i-bem"]'
32
+results_xpath = '//li[@class="serp-item"]'
33 33
 url_xpath = './/h2/a/@href'
34 34
 title_xpath = './/h2/a//text()'
35
-content_xpath = './/div[@class="serp-item__text"]//text()'
35
+content_xpath = './/div[@class="text-container typo typo_text_m typo_line_m organic__text"]//text()'
36 36
 
37 37
 
38 38
 def request(query, params):

+ 5
- 4
searx/settings.yml Visa fil

@@ -192,6 +192,7 @@ engines:
192 192
   - name : gigablast
193 193
     engine : gigablast
194 194
     shortcut : gb
195
+    timeout : 3.0
195 196
     disabled: True
196 197
 
197 198
   - name : gitlab
@@ -250,8 +251,8 @@ engines:
250 251
     engine        : xpath
251 252
     search_url    : https://play.google.com/store/search?q={query}&c=movies
252 253
     url_xpath     : //a[@class="title"]/@href
253
-    title_xpath   : //a[@class="title"]
254
-    content_xpath : //a[@class="subtitle"]
254
+    title_xpath   : //a[@class="title"]/@title
255
+    content_xpath : //a[contains(@class, "subtitle")]
255 256
     categories : videos
256 257
     shortcut : gpm
257 258
     disabled : True
@@ -282,8 +283,8 @@ engines:
282 283
     engine : xpath
283 284
     paging : True
284 285
     search_url : https://habrahabr.ru/search/page{pageno}/?q={query}
285
-    url_xpath : //div[@class="search_results"]//a[@class="post_title"]/@href
286
-    title_xpath : //div[@class="search_results"]//a[@class="post_title"]
286
+    url_xpath : //div[@class="search_results"]//a[contains(@class, "post__title_link")]/@href
287
+    title_xpath : //div[@class="search_results"]//a[contains(@class, "post__title_link")]
287 288
     content_xpath : //div[@class="search_results"]//div[contains(@class, "content")]
288 289
     categories : it
289 290
     timeout : 4.0