on master help sign in
Update XPath for Google engine
commita2ec27696c4af287005a44f4f4518d9e504a96b6 authorÉmilien Devos <contact@emiliendevos.be> dateMon 17 Jan 2022, 21:49 (5 years ago) parent6ebe9b1
1 file changed+4−4
searx/engines/google.py+4−4
searx/engines/google.py+4−4
@@ -108,8 +108,8 @@ filter_mapping = {
108108# specific xpath variables
109109# ------------------------
110110
111−# google results are grouped into <div class="g" ../>
112−results_xpath = '//div[@class="g"]'
111+# google results are grouped into <div class="g ..." ../>
112+results_xpath = '//div[contains(@class, "g")]'
113113
114114# google *sections* are no usual *results*, we ignore them
115115g_section_with_header = './g-section-with-header'
@@ -121,8 +121,8 @@ title_xpath = './/h3[1]'
121121# href=...>
122122href_xpath = './/div[@class="yuRUbf"]//a/@href'
123123
124−# in the result group there is <div class="IsZvec" ../> containing he *content*
125−content_xpath = './/div[@class="IsZvec"]'
124+# in the result group there is <div class="VwiC3b ..." ../> containing the *content*
125+content_xpath = './/div[contains(@class, "VwiC3b")]'
126126
127127# Suggestions are links placed in a *card-section*, we extract only the text
128128# from the links not the links itself.