Browse Source

[fix] google markup change - closes #489

Adam Tauber 9 years ago
parent
commit
66f48c2bf5
2 changed files with 12 additions and 12 deletions
  1. 2
    2
      searx/engines/google.py
  2. 10
    10
      searx/tests/engines/test_google.py

+ 2
- 2
searx/engines/google.py View File

@@ -90,7 +90,7 @@ url_map = 'https://www.openstreetmap.org/'\
90 90
 search_path = '/search'
91 91
 search_url = ('https://{hostname}' +
92 92
               search_path +
93
-              '?{query}&start={offset}&gbv=1&gws_rd=cr')
93
+              '?{query}&start={offset}&gbv=1&gws_rd=ssl')
94 94
 
95 95
 # other URLs
96 96
 map_hostname_start = 'maps.google.'
@@ -99,7 +99,7 @@ redirect_path = '/url'
99 99
 images_path = '/images'
100 100
 
101 101
 # specific xpath variables
102
-results_xpath = '//li[@class="g"]'
102
+results_xpath = '//div[@class="g"]'
103 103
 url_xpath = './/h3/a/@href'
104 104
 title_xpath = './/h3'
105 105
 content_xpath = './/span[@class="st"]'

+ 10
- 10
searx/tests/engines/test_google.py View File

@@ -40,7 +40,7 @@ class TestGoogleEngine(SearxTestCase):
40 40
         self.assertEqual(google.response(response), [])
41 41
 
42 42
         html = """
43
-        <li class="g">
43
+        <div class="g">
44 44
             <h3 class="r">
45 45
                 <a href="http://this.should.be.the.link/">
46 46
                     <b>This</b> is <b>the</b> title
@@ -94,35 +94,35 @@ class TestGoogleEngine(SearxTestCase):
94 94
                     </a>
95 95
                 </div>
96 96
             </div>
97
-        </li>
98
-        <li class="g">
97
+        </div>
98
+        <div class="g">
99 99
             <h3 class="r">
100 100
                 <a href="http://www.google.com/images?q=toto">
101 101
                     <b>This</b>
102 102
                 </a>
103 103
             </h3>
104
-        </li>
105
-        <li class="g">
104
+        </div>
105
+        <div class="g">
106 106
             <h3 class="r">
107 107
                 <a href="http://www.google.com/search?q=toto">
108 108
                     <b>This</b> is
109 109
                 </a>
110 110
             </h3>
111
-        </li>
112
-        <li class="g">
111
+        </div>
112
+        <div class="g">
113 113
             <h3 class="r">
114 114
                 <a href="€">
115 115
                     <b>This</b> is <b>the</b>
116 116
                 </a>
117 117
             </h3>
118
-        </li>
119
-        <li class="g">
118
+        </div>
119
+        <div class="g">
120 120
             <h3 class="r">
121 121
                 <a href="/url?q=url">
122 122
                     <b>This</b> is <b>the</b>
123 123
                 </a>
124 124
             </h3>
125
-        </li>
125
+        </div>
126 126
         <p class="_Bmc" style="margin:3px 8px">
127 127
             <a href="/search?num=20&amp;safe=off&amp;q=t&amp;revid=1754833769&amp;sa=X&amp;ei=-&amp;ved=">
128 128
                 suggestion <b>title</b>