Amazon.co.uk Price Checker (Part 2)

Building on my price checker (see part 1) I’ve now added in an option asking how much spends (a.k.a pocket money) is available and allowing for the end user to enter multiple ASINs before the program checks the prices.

Next step; storing the ASINs in/reading the ASINs from a file (e.g. a CSV file).


#Amazon.co.uk Price Checker V2 / geektechstuff
import bs4, requests
#Import the Beautiful Soup and Requests modules
headers = {‘User-Agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6’}
#Needed a headers otherwise Amazon.co.uk fails to give any details
spends=input(‘How much spends in £ is there?:’)
spends=float(spends)
amazlist=[]
maxLengthList=5
while len(amazlist)’)
ttext2=tail
head,sep,tail=ttext2.partition(‘<‘)
title=head.strip()
print(title)

ptext=str(asidprice)
head,sep,tail=ptext.partition(‘£’)
ptext2=tail
head,sep,tail=ptext2.partition(‘<‘) price=head print(‘£’+price) price=float(head) if price > spends:
print(“Still too expensive”)
else:
print(“Its cheap enough to purchase”)
#turns the spanIDs into strings and then removes HTML that I don’t need to print

Welcome to GeekTechStuff

my home away from home and where I will be sharing my adventures in the world of technology and all things geek.

The technology subjects have varied over the years from Python code to handle ciphers and Pig Latin, to IoT sensors in Azure and Python handling Bluetooth, to Ansible and Terraform and material around DevOps.

Let’s connect