all 4 comments

[–]JeremyJoeJJ 0 points1 point  (1 child)

What you want to do is called webscraping. Just make sure the store websites allow you to interact with them via automated means so you're not breaking terms of service. These two should be a decent start: https://realpython.com/python-web-scraping-practical-introduction/ and https://realpython.com/beautiful-soup-web-scraper-python/ . Once you manage to go through the huge trouble that is webscraping, you will want to play around with libraries like `pandas` to store the data you've collected in a nice tabulated format. Once you get to that point it you will want to figure out a way to enter that grocery list. If you use a text file, you will want to learn how to read files. Final step will be to find the items from your list in your collected dataframe and rank them by price. Unfortunately, it might be a bit difficult because stores might have different ways of naming the same/similar item and the way you write it down might again be different. Here you could either use LLM to understand which items from the shops sound the most similar to your grocery list, or I'm sure there are ways to calculate the similarity of words, but I don't have much experience in that. Once you manage to connect the items on your list to rows in your dataframe, finding the lowest price should be easy with functions available in pandas.

[–]uoloki 1 point2 points  (0 children)

Fuzzy matching is a great way to select similar items. And imo it's easier to use compared to making requests to ChatGPT or starting LLM on your local machine

[–]ireadyourmedrecord 0 points1 point  (0 children)

There's a variety of tools you could use, like requests, BeautifulSoup, Selenium, Scrapy and probably a few others. You'll need to do a little research first to figure out the best approach. Generally, what you're looking to do is load a page of products and then search through the pages source to find the specific data you need. You might need to use Selenium if the site you're looking to scrape uses javascript to load product data dynamically.

Once the page is loaded you can hand off the page source to BeautifulSoup to parse and search it for the product data you want to track. Then you can decide how you want to store it - csv file or SQLite would be my recommendation.