Fix price
This commit is contained in:
parent
b221494834
commit
e63ced82ae
1 changed files with 3 additions and 1 deletions
|
@ -306,9 +306,11 @@ def isbn_api(request, isbn):
|
||||||
authors = authors.getText().strip()
|
authors = authors.getText().strip()
|
||||||
|
|
||||||
price = decitre_soup.select('.product-add-to-cart-wrapper div.price span.final-price')
|
price = decitre_soup.select('.product-add-to-cart-wrapper div.price span.final-price')
|
||||||
|
logger.info(f'Fonud price {price}')
|
||||||
if price:
|
if price:
|
||||||
price = price[0]
|
price = price[0]
|
||||||
price = price.getText().replace('€', '').replace(',', '.').strip()
|
price = price.getText().replace('€', '').replace(',', '.').strip()
|
||||||
|
logger.info(f'Final price {price}')
|
||||||
|
|
||||||
year = None
|
year = None
|
||||||
editor = None
|
editor = None
|
||||||
|
@ -324,7 +326,7 @@ def isbn_api(request, isbn):
|
||||||
'title': title,
|
'title': title,
|
||||||
'authors': authors,
|
'authors': authors,
|
||||||
'isbn': isbn,
|
'isbn': isbn,
|
||||||
'price': float(price),
|
'price': float(price) if price else None,
|
||||||
'year': year,
|
'year': year,
|
||||||
'editor': editor,
|
'editor': editor,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue