Compare commits

..

2 Commits

Author SHA1 Message Date
Markus Heiser b84ee9ac60
Merge pull request #1686 from asenov/fix-bing_bideos
[fix] Bing videos search Index error
2022-08-22 08:10:46 +02:00
M Asenov faa32d5773 fixed xpath selector for appropriate results 2022-08-21 20:08:00 +01:00
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ def response(resp):
dom = html.fromstring(resp.text) dom = html.fromstring(resp.text)
for result in dom.xpath('//div[@class="dg_u"]'): for result in dom.xpath('//div[@class="dg_u"]/div[contains(@class, "mc_vtvc")]'):
metadata = loads(result.xpath('.//div[@class="vrhdata"]/@vrhm')[0]) metadata = loads(result.xpath('.//div[@class="vrhdata"]/@vrhm')[0])
info = ' - '.join(result.xpath('.//div[@class="mc_vtvc_meta_block"]//span/text()')).strip() info = ' - '.join(result.xpath('.//div[@class="mc_vtvc_meta_block"]//span/text()')).strip()
content = '{0} - {1}'.format(metadata['du'], info) content = '{0} - {1}'.format(metadata['du'], info)