mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-27 20:55:06 +01:00
Support for amazon's new results page markup
This commit is contained in:
parent
bef20cf124
commit
e32aae3b83
1 changed files with 5 additions and 1 deletions
|
|
@ -687,7 +687,11 @@ def title_ok(title):
|
|||
return True
|
||||
|
||||
for div in root.xpath(r'//div[starts-with(@id, "result_")]'):
|
||||
for a in div.xpath(r'descendant::a[@class="title" and @href]'):
|
||||
links = div.xpath(r'descendant::a[@class="title" and @href]')
|
||||
if not links:
|
||||
# New amazon markup
|
||||
links = div.xpath('descendant::h3/a[@href]')
|
||||
for a in links:
|
||||
title = tostring(a, method='text', encoding=unicode)
|
||||
if title_ok(title):
|
||||
matches.append(a.get('href'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue