|
.oO SearXNG Developer Documentation Oo.
|
Functions | |
| None | request (str query, "OnlineParams" params) |
| EngineResults | response ("SXNG_Response" resp) |
| dict[str, int] | time_range_args ("OnlineParams" params) |
| detect_google_captcha (ElementType dom) | |
| tuple[list[str], str, str, datetime|None] | parse_gs_a (str|None text) |
Variables | |
| dict | about |
| list | categories = ["science", "scientific publications"] |
| bool | paging = True |
| int | max_page = 50 |
| bool | language_support = True |
| bool | time_range_support = True |
| bool | safesearch = False |
| bool | send_accept_language_header = True |
Google Scholar is a freely accessible web search engine that indexes the full
text or metadata of scholarly literature across an array of publishing formats
and disciplines.
Compared to other Google services the Scholar engine has a simple GET REST-API
and there does not exists ``async`` API. Even though the API slightly vintage
we can make use of the :ref:`google API` to assemble the arguments of the GET
request.
Configuration
=============
.. code:: yaml
- name: google scholar
engine: google_scholar
shortcut: gos
Implementations
===============
| searx.engines.google_scholar.detect_google_captcha | ( | ElementType | dom | ) |
In case of CAPTCHA Google Scholar open its own *not a Robot* dialog and is not redirected to ``sorry.google.com``.
Definition at line 190 of file google_scholar.py.
| tuple[list[str], str, str, datetime | None] searx.engines.google_scholar.parse_gs_a | ( | str | None | text | ) |
Parse the text written in green.
Possible formats:
* "{authors} - {journal}, {year} - {publisher}"
* "{authors} - {year} - {publisher}"
* "{authors} - {publisher}"
Definition at line 198 of file google_scholar.py.
| None searx.engines.google_scholar.request | ( | str | query, |
| "OnlineParams" | params ) |
Google-Scholar search request
Definition at line 76 of file google_scholar.py.
References time_range_args().
| EngineResults searx.engines.google_scholar.response | ( | "SXNG_Response" | resp | ) |
Parse response from Google Scholar
Definition at line 97 of file google_scholar.py.
| dict[str, int] searx.engines.google_scholar.time_range_args | ( | "OnlineParams" | params | ) |
Returns a dictionary with a time range arguments based on
``params["time_range"]``.
Google Scholar supports a detailed search by year. Searching by *last
month* or *last week* (as offered by SearXNG) is uncommon for scientific
publications and is not supported by Google Scholar.
To limit the result list when the users selects a range, all the SearXNG
ranges (*day*, *week*, *month*, *year*) are mapped to *year*. If no range
is set an empty dictionary of arguments is returned.
Example; when user selects a time range and we find ourselves in the year
2025 (current year minus one):
.. code:: python
{ "as_ylo" : 2024 }
Definition at line 164 of file google_scholar.py.
Referenced by request().
| dict searx.engines.google_scholar.about |
Definition at line 53 of file google_scholar.py.
| list searx.engines.google_scholar.categories = ["science", "scientific publications"] |
Definition at line 63 of file google_scholar.py.
| bool searx.engines.google_scholar.language_support = True |
Definition at line 70 of file google_scholar.py.
| int searx.engines.google_scholar.max_page = 50 |
Definition at line 65 of file google_scholar.py.
| bool searx.engines.google_scholar.paging = True |
Definition at line 64 of file google_scholar.py.
| bool searx.engines.google_scholar.safesearch = False |
Definition at line 72 of file google_scholar.py.
| bool searx.engines.google_scholar.send_accept_language_header = True |
Definition at line 73 of file google_scholar.py.
| bool searx.engines.google_scholar.time_range_support = True |
Definition at line 71 of file google_scholar.py.