Browse Source

[fix] bing_news

Alexandre Flament 9 years ago
parent
commit
3d70921175
2 changed files with 17 additions and 17 deletions
  1. 1
    1
      searx/engines/bing_news.py
  2. 16
    16
      searx/tests/engines/test_bing_news.py

+ 1
- 1
searx/engines/bing_news.py View File

@@ -65,7 +65,7 @@ def response(resp):
65 65
 
66 66
         # parse publishedDate
67 67
         publishedDateXPath = result.xpath('.//div[@class="sn_txt"]/div'
68
-                                          '//span[contains(@class,"sn_ST")]'
68
+                                          '//div[contains(@class,"sn_ST")]'
69 69
                                           '//span[contains(@class,"sn_tm")]')
70 70
 
71 71
         publishedDate = escape(extract_text(publishedDateXPath))

+ 16
- 16
searx/tests/engines/test_bing_news.py View File

@@ -52,11 +52,11 @@ class TestBingNewsEngine(SearxTestCase):
52 52
             <div class="sn_txt">
53 53
                 <div class="sn_oi">
54 54
                     <span class="sn_snip">Article Content</span>
55
-                    <span class="sn_ST">
55
+                    <div class="sn_ST">
56 56
                         <cite class="sn_src">metronews.fr</cite>
57 57
                         &nbsp;&#0183;&#32;
58 58
                         <span class="sn_tm">44 minutes ago</span>
59
-                    </span>
59
+                    </div>
60 60
                 </div>
61 61
             </div>
62 62
         </div>
@@ -84,11 +84,11 @@ class TestBingNewsEngine(SearxTestCase):
84 84
             <div class="sn_txt">
85 85
                 <div class="sn_oi">
86 86
                     <span class="sn_snip">Article Content</span>
87
-                    <span class="sn_ST">
87
+                    <div class="sn_ST">
88 88
                         <cite class="sn_src">metronews.fr</cite>
89 89
                         &nbsp;&#0183;&#32;
90 90
                         <span class="sn_tm">44 minutes ago</span>
91
-                    </span>
91
+                    </div>
92 92
                 </div>
93 93
             </div>
94 94
         </div>
@@ -106,11 +106,11 @@ class TestBingNewsEngine(SearxTestCase):
106 106
             <div class="sn_txt">
107 107
                 <div class="sn_oi">
108 108
                     <span class="sn_snip">Article Content</span>
109
-                    <span class="sn_ST">
109
+                    <div class="sn_ST">
110 110
                         <cite class="sn_src">metronews.fr</cite>
111 111
                         &nbsp;&#0183;&#32;
112 112
                         <span class="sn_tm">3 hours, 44 minutes ago</span>
113
-                    </span>
113
+                    </div>
114 114
                 </div>
115 115
             </div>
116 116
         </div>
@@ -128,11 +128,11 @@ class TestBingNewsEngine(SearxTestCase):
128 128
             <div class="sn_txt">
129 129
                 <div class="sn_oi">
130 130
                     <span class="sn_snip">Article Content</span>
131
-                    <span class="sn_ST">
131
+                    <div class="sn_ST">
132 132
                         <cite class="sn_src">metronews.fr</cite>
133 133
                         &nbsp;&#0183;&#32;
134 134
                         <span class="sn_tm">44 hours ago</span>
135
-                    </span>
135
+                    </div>
136 136
                 </div>
137 137
             </div>
138 138
         </div>
@@ -150,11 +150,11 @@ class TestBingNewsEngine(SearxTestCase):
150 150
             <div class="sn_txt">
151 151
                 <div class="sn_oi">
152 152
                     <span class="sn_snip">Article Content</span>
153
-                    <span class="sn_ST">
153
+                    <div class="sn_ST">
154 154
                         <cite class="sn_src">metronews.fr</cite>
155 155
                         &nbsp;&#0183;&#32;
156 156
                         <span class="sn_tm">2 days ago</span>
157
-                    </span>
157
+                    </div>
158 158
                 </div>
159 159
             </div>
160 160
         </div>
@@ -172,11 +172,11 @@ class TestBingNewsEngine(SearxTestCase):
172 172
             <div class="sn_txt">
173 173
                 <div class="sn_oi">
174 174
                     <span class="sn_snip">Article Content</span>
175
-                    <span class="sn_ST">
175
+                    <div class="sn_ST">
176 176
                         <cite class="sn_src">metronews.fr</cite>
177 177
                         &nbsp;&#0183;&#32;
178 178
                         <span class="sn_tm">27/01/2015</span>
179
-                    </span>
179
+                    </div>
180 180
                 </div>
181 181
             </div>
182 182
         </div>
@@ -194,11 +194,11 @@ class TestBingNewsEngine(SearxTestCase):
194 194
             <div class="sn_txt">
195 195
                 <div class="sn_oi">
196 196
                     <span class="sn_snip">Article Content</span>
197
-                    <span class="sn_ST">
197
+                    <div class="sn_ST">
198 198
                         <cite class="sn_src">metronews.fr</cite>
199 199
                         &nbsp;&#0183;&#32;
200 200
                         <span class="sn_tm">Il y a 3 heures</span>
201
-                    </span>
201
+                    </div>
202 202
                 </div>
203 203
             </div>
204 204
         </div>
@@ -222,11 +222,11 @@ class TestBingNewsEngine(SearxTestCase):
222 222
         <div class="sn_txt">
223 223
             <div class="sn_oi">
224 224
                 <span class="sn_snip">Article Content</span>
225
-                <span class="sn_ST">
225
+                <div class="sn_ST">
226 226
                     <cite class="sn_src">metronews.fr</cite>
227 227
                     &nbsp;&#0183;&#32;
228 228
                     <span class="sn_tm">44 minutes ago</span>
229
-                </span>
229
+                </div>
230 230
             </div>
231 231
         </div>
232 232
         """