Skip to content

Commit

Permalink
Fix amazon
Browse files Browse the repository at this point in the history
Pretty messy
  • Loading branch information
alchzh authored Mar 26, 2017
1 parent 9336443 commit dd12d8c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/amazon.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ def amazon(text, _parsed=False):
r"|Spedizione gratuita)", item.text, re.I):
tags.append("$(b)Free Shipping$(b)")

price = item.find('span', {'class': ['s-price', 'a-color-price']}).text
try:
price = item.find('span', {'class': ['s-price', 'a-color-price']}).text
except AttributeError:
for i in item.find_all('sup', class_='sx-price-fractional'):
i.string.replace_with('.' + i.string)
price = item.find('span', {'class': 'sx-price'}).text

# use a whole lot of BS4 and regex to get the ratings
try:
Expand Down

0 comments on commit dd12d8c

Please sign in to comment.