Files
Tirsvad 7d139f86c7 MIL-006 wiki in three languages
Delivers MIL-006 tasks 1 to 4: the wiki pages in `docs/wiki/` in English, Danish and Bahasa Malaysia (Home plus one page per lecture step, each with its screenshot and a "what we gained" section, and a shared `_Sidebar.md`), laid out as `framework/process/wiki.md` says (English without suffix, `-da` and `-ms` for the others, a language line on every page). The README links to the wiki.

Checked: the three languages have the same five pages; every page starts with the language line; code, commands and file names stay in English. There is no QC checklist for wiki pages, so there is no RC record. Publishing to the host's wiki (task 5, issue #31) follows after this merge.

Task: MIL-006#1
Task: MIL-006#2
Task: MIL-006#3
Task: MIL-006#4
2026-10-28 14:50:58 +08:00

19 lines
1.2 KiB
Markdown

# Step 1: scrape the price
🌐 **English** · [Dansk](Step-1-Scrape-the-Price-da) · [Bahasa Melayu](Step-1-Scrape-the-Price-ms)
**Assignment.** Use BeautifulSoup to get the price of the Instant Pot on the practice page as a floating point number and print it.
**What we built.** `get_title(html)` and `get_price(html)` in `infrastructure/scraper.py`. The price is in the first element with class `a-offscreen`; its text is `$99.99`. `split("$")` drops the currency sign and `float()` makes the number.
![The practice page](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/047-amazon-price-tracker/raw/branch/main/docs/images/step-1-practice-page.png)
![The bot prints the title and the price](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/047-amazon-price-tracker/raw/branch/main/docs/images/step-1-run.png)
**What we gained**
- How to find an element in the browser's inspector and select it with BeautifulSoup (`select_one`).
- How to clean scraped text (`strip`, `split`) before converting it with `float()`.
- Tests that use a saved copy of the page, so they run without the network.
- A clear error (`PriceNotFoundError`) when the element is missing.