Playwright
Collect data from dynamic sites with Playwright. Practise on simulated stores that behave like the real thing. 14 modules of 10 minutes each, with questions that check your answers in the browser.
Foundations
- 1. How pages load; static vs dynamic (why requests isn't enough)FreeWhat really happens when a page loads, why some data never appears in the raw HTML, and what a real browser does differently.
- 2. Setting up Playwright and launching a browserFreeInstall Playwright with uv, launch a browser from Python, and understand the three objects every script uses (browser, context, page) and how to close them cleanly.
- 3. Navigating pages and taking screenshotsFreeGo to URLs and check the response status, follow links, move back and forward, and save screenshots of pages and elements to see what your scraper saw.
- 4. Selecting elements (selectors, get_by_role / get_by_text)FreeFind exactly the elements you want with CSS selectors and Playwright's user-facing locators, narrow them with filters, and understand strict mode.
Intermediate
- 5. Extracting text and attributesFreeRead text, attributes and hidden data from elements, turn displayed values like "Rp 5.999.000" into numbers, and build clean lists of records from repeated page elements.
- 6. Waiting for elements and content (auto-waiting)FreeUnderstand why scrapers read pages too early, how Playwright's auto-waiting fixes most of it, and how to wait explicitly, set timeouts, and handle content that never arrives.
- 7. Clicking, typing, and filling formsFreeInteract with pages like a user, filling and submitting search forms, clicking buttons, dismissing cookie banners that block clicks, and checking whether controls are enabled.
- 8. Handling pagination and infinite scrollFreeCollect every item from multi-page listings by following Next links, using URL patterns safely, clicking Load more, and scrolling infinite feeds until they end.
Advanced
- 9. Network interception: reading the background API/JSONProWatch the requests a page makes, capture the JSON behind dynamic content with expect_response, call those APIs directly, and block resources you don't need with page.route.
- 10. Headless mode, user agents, and basic anti-bot handlingProLearn what a server can tell about your browser, why automated traffic gets blocked, how to identify your scraper honestly with a user agent, and when a block means you should stop.
- 11. Scraping behind logins (cookies, sessions)ProLog in with Playwright, understand session cookies, save and reuse a logged-in state, call authenticated APIs with requests, and keep credentials out of your code.
- 12. Saving scraped data cleanly (CSV, JSON, DataFrame)ProTurn scraped records into a typed pandas DataFrame, save them as CSV and JSON, record when data was collected, de-duplicate across runs, and build a price history over time.
Expert
- 13. Structuring a reusable scraper (functions, config, retries)ProTurn a script into a maintainable scraper with a config object, a selector map, small parsing functions, a class that manages the browser, retries with backoff for rate limits, and logging.
- 14. Ethics, rate limiting, and robots.txtProDecide whether you should scrape a site, read robots.txt with Python, rate-limit and cache your requests, and handle personal data responsibly.
Track project
- Scraping Project: Toko Kita's price watchProThree graded tasks against a practice shop. Collect a competitor's whole catalogue across pages, check stock on detail pages without breaking their rules, and compare their prices with yours through their JSON API, saved as a CSV.
Pro modules unlock with one payment of Rp 149.000, yours to keep.