summaryrefslogtreecommitdiff
path: root/searx/engines/google.py
AgeCommit message (Collapse)Author
2021-11-25[fix] google engine - suggestionMarkus Heiser
BTW: google no longer offers *spelling suggestions* Closes: https://github.com/searxng/searxng/issues/442 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-07[pylint] engines: drop no longer needed 'missing-function-docstring'Markus Heiser
Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914168470 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-07[fix] drop useless pylint: disable=undefined-variableMarkus Heiser
Since 7b235a1 (see line 591) it is no longer needed to disable 'undefined-variable' for names defined in:: PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914068609 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-06[mod] one logger per engine - drop obsolete logger.getChildMarkus Heiser
Remove the no longer needed `logger = logger.getChild(...)` from engines. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-08-21[enh] google: add filter=0 to Google engine for more resultsNoémi Ványi
backport from searx ( 23b3b56a06ef831af0a1b30a12c26ebd50e329bb )
2021-07-15Add missing parameter for mobile UI searchÉmilien Devos
2021-06-21[docs] add documentation from the sources of the google enginesMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-21[fix] google answers: normalize space of the answers.Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-21[mod] google engine: reduce mobile UI parameters to what is neededMarkus Heiser
Reverse engineering shows that not all of the parameters used by google's mobile UI (aka "more results" button) are needed [1]. [1] https://github.com/searxng/searxng/pull/160#issuecomment-865013625 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-21[mod] google: add "use_mobile_ui" parameter to use mobile endpoint.Alexandre Flament
disable by default, it has to be enabled in settings.yml related to #159
2021-06-11[mod] google - get_lang_info add documentataion & commentsMarkus Heiser
BTW: remove obsolete log messages from google engine Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-10[enh] google engine: supports "default language"Alexandre Flament
Same behaviour behaviour than Whoogle [1]. Only the google engine with the "Default language" choice "(all)"" is changed by this patch. When searching for a locate place, the result are in the expect language, without missing results [2]: > When a language is not specified, the language interpretation is left up to > Google to decide how the search results should be delivered. The query parameters are copied from Whoogle. With the ``all`` language: - add parameter ``source=lnt`` - don't use parameter ``lr`` - don't add a ``Accept-Language`` HTTP header. The new signature of function ``get_lang_info()`` is: lang_info = get_lang_info(params, lang_list, custom_aliases, supported_any_language) Argument ``supported_any_language`` is True for google.py and False for the other google engines. With this patch the function now returns: - query parameters: ``lang_info['params']`` - HTTP headers: ``lang_info['headers']`` - and as before this patch: - ``lang_info['subdomain']`` - ``lang_info['country']`` - ``lang_info['language']`` [1] https://github.com/benbusby/whoogle-search [2] https://github.com/benbusby/whoogle-search/releases/tag/v0.5.4
2021-04-26[pylint] tag PYLINT_FILES by comment `# lint: pylint`Markus Heiser
These py files are linted by `test.pylint`, all other files are linted by `test.pep8`. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-19Merge remote-tracking branch 'searx/master'Alexandre Flament
2021-04-11Fix grammar mistake in debug log outputRobin Schneider
2021-04-10[enh] replace requests by httpxAlexandre Flament
2021-02-01[mod] dynamically set language_support variableAlexandre Flament
The language_support variable is set to True by default, and set to False in only 5 engines. Except the documentation and the /config URL, this variable is not used. This commit remove the variable definition in the engines, and set value according to supported_languages length: False when the length is 0, True otherwise. Close #2485
2021-01-28[fix] google: avoid unnecessary SearxEngineXPathException errorsMarkus Heiser
Avoid SearxEngineXPathException errors when parsing non valid results:: .//div[@class="yuRUbf"]//a/@href index 0 not found Traceback (most recent call last): File "./searx/engines/google.py", line 274, in response url = eval_xpath_getindex(result, href_xpath, 0) File "./searx/searx/utils.py", line 608, in eval_xpath_getindex raise SearxEngineXPathException(xpath_spec, 'index ' + str(index) + ' not found') searx.exceptions.SearxEngineXPathException: .//div[@class="yuRUbf"]//a/@href index 0 not found Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-01-28[fix] normalize the language & region aspects of all google enginesMarkus Heiser
BTW: make the engines ready for search.checker: - replace eval_xpath by eval_xpath_getindex and eval_xpath_list - google_images: remove outer try/except block Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-01-22[fix] revise of the google-news engineMarkus Heiser
This revise is based on the methods developed in the revise of the google engine (see commit 410c2f9). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-01-14[enh] engines: add about variableAlexandre Flament
move meta information from comment to the about variable so the preferences, the documentation can show these information
2020-12-03[mod] various engines: use eval_xpath* functions and searx.exceptions.*Alexandre Flament
Engine list: ahmia, duckduckgo_images, elasticsearch, google, google_images, google_videos, youtube_api
2020-10-02[mod] move extract_text, extract_url to searx.utilsAlexandre Flament
2020-10-01[fix] google engine - div classes has been renamed in HTML reultMarkus Heiser
Since 1. October 2020 google has changed the 'class' attribute of the HTML result page. Fix the xpath expressions and ignore <div class="g" ../> sections which do not match to title's xpath expression. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-09-22fetch google's search langs rather than ui langsMarc Abonce Seguin
2020-09-10Drop Python 2 (1/n): remove unicode string and url_utilsDalf
2020-07-08[fix] pep8Adam Tauber
2020-07-07[fix] revise google engineMarkus Heiser
this commit is picked from #1985
2019-12-07[fix] update xpaths for new google results pageMarc Abonce Seguin
2019-12-02Merge pull request #1744 from dalf/optimizationsAdam Tauber
[mod] speed optimization
2019-11-22[fix] Force Google old UI with a new user agentEmilien Devos
2019-11-15[mod] speed optimizationDalf
compile XPath only once avoid redundant call to urlparse get_locale(webapp.py): avoid useless call to request.accept_languages.best_match
2019-05-29[fix] Force Google old UI (#1597)Emilien Devos
2019-01-07Revert "remove 'all' option from search languages"Noémi Ványi
This reverts commit 4d1770398a6af8902e75c0bd885781584d39e796.
2019-01-06[fix] fetch google's supported languagesMarc Abonce Seguin
2019-01-06[fix] check language aliases when setting search languageMarc Abonce Seguin
2018-04-18[fix] force English results in Google when using en-USMarc Abonce Seguin
2018-03-27refactor engine's search language handlingMarc Abonce Seguin
Add match_language function in utils to match any user given language code with a list of engine's supported languages. Also add language_aliases dict on each engine to translate standard language codes into the custom codes used by the engine.
2018-03-20fix fetch_langauges to be more accurateMarc Abonce Seguin
Add languages supported by either all default general engines or 10 engines.
2017-12-18send constant cookie with query to GoogleNoémi Ványi
2017-12-06remove 'all' option from search languagesmarc
2017-12-05[fix] handle /sorry redirectsAdam Tauber
2017-11-22[fix] use english in google engine if no language was set - this prevents ↵Adam Tauber
guessing the language by the IP of the instance
2017-11-22[fix] revert language changes to prevent CAPTCHAsAdam Tauber
2017-11-21[fix] fix language support of googleAdam Tauber
2017-05-15[enh] py3 compatibilityAdam Tauber
2017-01-27[enh] add result number parsing to google engineAdam Tauber
2017-01-16[enh] show spelling correctionsDavid A Roberts
2017-01-05[enh] add instant answers to google engineAdam Tauber
2016-12-15tests for _fetch_supported_languages in enginesmarc
and refactor method to make it testable without making requests