currency fix

This commit is contained in:
Sam Hadow 2024-02-12 21:30:17 +01:00
parent 49574602ed
commit c88044a260
2 changed files with 8 additions and 2 deletions

View File

@ -65,8 +65,11 @@ def check_item(settings_item):
image_link = re.sub(r'jpg_[0-9]+x[0-9]+', "jpg_800x800", image_link) # get bigger image instead of preview
break
# get currency
currency = elem[12] if (len(elem[12])>0) else elem[14]
# skuId, quantity, discount_percentage, price, currency, choice_delivery, image
extract[key] = {"skuid": elem[2], "quantity": elem[3], "discount_percentage": discount, "price": price, "currency": elem[12], "choice_delivery": is_choice, "image": image_link}
extract[key] = {"skuid": elem[2], "quantity": elem[3], "discount_percentage": discount, "price": price, "currency": currency, "choice_delivery": is_choice, "image": image_link}
else:
print(f'Failed to fetch target page. Status code: {target_page_response.status_code}')

View File

@ -28,7 +28,10 @@ if __name__ == '__main__':
# c_l = ["1005006062371246", ["Pr Tactile 62g x35"]]
# print(check_item(c_l))
c_l = ["1005005676358693", ["5x250mm 5pcs"]]
# c_l = ["1005005676358693", ["5x250mm 5pcs"]]
# print(check_item(c_l))
c_l = ["1005005824413309", ["00350"]]
print(check_item(c_l))
# TODO : fix regex for this item