Skip to main content
πŸ”’ Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial β†’
⚑
← Coursesβ€ΊPython for Office WorkersModule 6 Β· API integrations Β· Recapβ€ΊπŸŽ― Review: Automation module 6 recapscenario28 / 54
+80 XP
Task
Build `web_scrape_table(html_str)` β€” a tiny "extract rows from an HTML table" helper for scripts that don't want a BeautifulSoup dependency: - `html_str` contains one `<table>...</table>` with header row + body rows. - Each row is `<tr><td>cell1</td><td>cell2</td>...</tr>`. - First `<tr>` is the header row (column names). - Return a list of dicts, one per body row, keyed by header. - Empty/missing table β†’ empty list. - Use simple string slicing β€” no regex, no html parser. The harness only feeds well-formed input.
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
πŸ“Š Result
Press Run to see result...

πŸ’¬ Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…