Task

Write a script, which checks prices on two electronics retailers. The script will need to make use of a database backend and allow for historic pricing to be retrieved. The script may be developed in any of the languages covered in the unit.

You will need to select the two electronics retailers, it is suggested that you review the formatting of pages to ensure a site that is consistent and scrapable without an undue amount of additional work. In order to meet the requirements for this assignment they should also have functionality to search for products.

  • The script will need to perform a search on the sites selected for a product.
  • The script will need to store the date, time, site, product name & price in a database.
  • When storing details of an item the script will assign an item number, all future prices for this item will be stored with the same item number.
  • The script will repeat this search whenever it is run with the update parameter
    • On first execution the update parameter should create the database and perform the initial price check.
    • On subsequent execution the prices should be updated and a new entry inserted in the database
  • The script will accept a search parameter, which searches the local by product name and displays results.
  • The script will accept the history parameter with a second parameter of an item number, it will then display historic prices for that item.

Example commands*:

$ python pricewatch.py update

Detected first run, creating database
Updating prices from Site A
Site A update complete, 23 prices inserted
Updating prices from site B
Site B update complete, 42 prices inserted
$ python pricewatch.py search widget

----------------------------------------------------
| # | Name | Store | Price |
----------------------------------------------------
| 22 | Fancy Widget | Site A | $63.30 |
| 31 | Normal Widget | Site A | $33.90 |
| 42 | Normal Widget | Site B | $21.15 |
----------------------------------------------------
$ python pricewatch.py history 22

Showing history for “Fancy Widget”, from Store A
-------------------------------
| Date | Time | Price |
-------------------------------
| 11/03/2012 | 11:22 | $56.40 |
| 12/03/2012 | 23:14 | $99.95 |
| 15/03/2012 | 01:08 | $63.30 |
-------------------------------

*Note all example commands are assuming that you are writing the software in python, please assume the equivalent for whichever language you select.

You may hard code the details of the sites, regular expressions and the search term you wish to use

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.