.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.engines.ebay Namespace Reference

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['shopping']
 
bool paging = True
 
 base_url = None
 
str search_url = '/sch/i.html?_nkw={query}&_sacat={pageno}'
 
str results_xpath = '//li[contains(@class, "s-item")]'
 
str url_xpath = './/a[@class="s-item__link"]/@href'
 
str title_xpath = './/h3[@class="s-item__title"]'
 
str content_xpath = './/div[@span="SECONDARY_INFO"]'
 
str price_xpath = './/div[contains(@class, "s-item__detail")]/span[@class="s-item__price"][1]/text()'
 
str shipping_xpath = './/span[contains(@class, "s-item__shipping")]/text()'
 
str source_country_xpath = './/span[contains(@class, "s-item__location")]/text()'
 
str thumbnail_xpath = './/img[@class="s-item__image-img"]/@src'
 

Detailed Description

 Ebay (Videos, Music, Files)

Function Documentation

◆ request()

searx.engines.ebay.request ( query,
params )

Definition at line 39 of file ebay.py.

39def request(query, params):
40 params['url'] = f'{base_url}' + search_url.format(query=quote(query), pageno=params['pageno'])
41 return params
42
43

◆ response()

searx.engines.ebay.response ( resp)

Definition at line 44 of file ebay.py.

44def response(resp):
45 results = []
46
47 dom = html.fromstring(resp.text)
48 results_dom = dom.xpath(results_xpath)
49 if not results_dom:
50 return []
51
52 for result_dom in results_dom:
53 url = extract_text(result_dom.xpath(url_xpath))
54 title = extract_text(result_dom.xpath(title_xpath))
55 content = extract_text(result_dom.xpath(content_xpath))
56 price = extract_text(result_dom.xpath(price_xpath))
57 shipping = extract_text(result_dom.xpath(shipping_xpath))
58 source_country = extract_text(result_dom.xpath(source_country_xpath))
59 thumbnail = extract_text(result_dom.xpath(thumbnail_xpath))
60
61 if title == "":
62 continue
63
64 results.append(
65 {
66 'url': url,
67 'title': title,
68 'content': content,
69 'price': price,
70 'shipping': shipping,
71 'source_country': source_country,
72 'thumbnail': thumbnail,
73 'template': 'products.html',
74 }
75 )
76
77 return results

Variable Documentation

◆ about

dict searx.engines.ebay.about
Initial value:
1= {
2 "website": 'https://www.ebay.com',
3 "wikidata_id": 'Q58024',
4 "official_api_documentation": 'https://developer.ebay.com/',
5 "use_official_api": False,
6 "require_api_key": False,
7 "results": 'HTML',
8}

Definition at line 12 of file ebay.py.

◆ base_url

searx.engines.ebay.base_url = None

Definition at line 26 of file ebay.py.

◆ categories

list searx.engines.ebay.categories = ['shopping']

Definition at line 21 of file ebay.py.

◆ content_xpath

str searx.engines.ebay.content_xpath = './/div[@span="SECONDARY_INFO"]'

Definition at line 32 of file ebay.py.

◆ paging

bool searx.engines.ebay.paging = True

Definition at line 22 of file ebay.py.

◆ price_xpath

str searx.engines.ebay.price_xpath = './/div[contains(@class, "s-item__detail")]/span[@class="s-item__price"][1]/text()'

Definition at line 33 of file ebay.py.

◆ results_xpath

str searx.engines.ebay.results_xpath = '//li[contains(@class, "s-item")]'

Definition at line 29 of file ebay.py.

◆ search_url

str searx.engines.ebay.search_url = '/sch/i.html?_nkw={query}&_sacat={pageno}'

Definition at line 27 of file ebay.py.

◆ shipping_xpath

str searx.engines.ebay.shipping_xpath = './/span[contains(@class, "s-item__shipping")]/text()'

Definition at line 34 of file ebay.py.

◆ source_country_xpath

str searx.engines.ebay.source_country_xpath = './/span[contains(@class, "s-item__location")]/text()'

Definition at line 35 of file ebay.py.

◆ thumbnail_xpath

str searx.engines.ebay.thumbnail_xpath = './/img[@class="s-item__image-img"]/@src'

Definition at line 36 of file ebay.py.

◆ title_xpath

str searx.engines.ebay.title_xpath = './/h3[@class="s-item__title"]'

Definition at line 31 of file ebay.py.

◆ url_xpath

str searx.engines.ebay.url_xpath = './/a[@class="s-item__link"]/@href'

Definition at line 30 of file ebay.py.