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 rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesPython for Office WorkersModule 3 · Web ScrapingBeautifulSoup — extract a tablepredict10 / 54
+125 XP
Task
Given this HTML scraped into `table`: <table> <tr><th>Item</th><th>Price</th></tr> <tr><td>Pen</td><td>$3</td></tr> <tr><td>Pad</td><td>$12</td></tr> </table> What does for tr in table.find_all("tr")[1:]: cells = [td.get_text(strip=True) for td in tr.find_all("td")] print(cells) print? Type the two list literals on two lines.
Predict the output

Read the code carefully

What will the program print? Write here:

💬 Discussion

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