mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
add shipping, delivery, and site info to google shopping engine
This commit is contained in:
parent
cc190603b3
commit
29d82c276f
1 changed files with 9 additions and 0 deletions
|
@ -25,6 +25,9 @@ title_xpath = './/h2[@class="MPhl6c pqv9ne azTb0d ulfEhd YAEPj XkyFEf"]'
|
|||
url_xpath = './/a[@class="loT5Qd kneS6c"]/@href'
|
||||
price_xpath = './/span[@class="aZK3gc Lhpu7d"]'
|
||||
thumbnail_xpath = './/img[@class="Ws3Esf"]/@src'
|
||||
shipping_xpath = './/div[@class="KT7Ysc"]'
|
||||
site_xpath = './/div[@class="X8HN5e FAZYFf ApBhXe"]'
|
||||
condition_xpath = './/span[@class="JkJxid HFeBod"]'
|
||||
|
||||
|
||||
def request(query, params):
|
||||
|
@ -45,6 +48,9 @@ def response(resp):
|
|||
title = extract_text(result.xpath(title_xpath))
|
||||
price = extract_text(result.xpath(price_xpath))
|
||||
thumbnail = extract_text(result.xpath(thumbnail_xpath))
|
||||
shipping = extract_text(result.xpath(shipping_xpath))
|
||||
site = extract_text(result.xpath(site_xpath))
|
||||
condition = extract_text(result.xpath(condition_xpath))
|
||||
|
||||
results.append(
|
||||
{
|
||||
|
@ -53,6 +59,9 @@ def response(resp):
|
|||
"price": price,
|
||||
"thumbnail": thumbnail,
|
||||
"template": "products.html",
|
||||
"shipping": shipping,
|
||||
"content": condition,
|
||||
"source_country": site,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue