on master help sign in
Update XPath for Google engine
a2ec276Émilien Devos
searx/engines/google.py+4−4
@@ -108,8 +108,8 @@ filter_mapping = {
108# specific xpath variables
108# specific xpath variables
109# ------------------------
109# ------------------------
110
110
111−# google results are grouped into <div class="g" ../>
111+# google results are grouped into <div class="g ..." ../>
112−results_xpath = '//div[@class="g"]'
112+results_xpath = '//div[contains(@class, "g")]'
113
113
114# google *sections* are no usual *results*, we ignore them
114# google *sections* are no usual *results*, we ignore them
115g_section_with_header = './g-section-with-header'
115g_section_with_header = './g-section-with-header'
@@ -121,8 +121,8 @@ title_xpath = './/h3[1]'
121# href=...>
121# href=...>
122href_xpath = './/div[@class="yuRUbf"]//a/@href'
122href_xpath = './/div[@class="yuRUbf"]//a/@href'
123
123
124−# in the result group there is <div class="IsZvec" ../> containing he *content*
124+# in the result group there is <div class="VwiC3b ..." ../> containing the *content*
125−content_xpath = './/div[@class="IsZvec"]'
125+content_xpath = './/div[contains(@class, "VwiC3b")]'
126
126
127# Suggestions are links placed in a *card-section*, we extract only the text
127# Suggestions are links placed in a *card-section*, we extract only the text
128# from the links not the links itself.
128# from the links not the links itself.