Python Web Scraping and Data Extraction Training Course

Duration 10 days 18 modules · 65 contact hours
Level Intermediate Certificate on completion
Who attends Data Analyst, Business Intelligence Analyst and others
Fee from USD 2,200 KSh 190,000 for Kenyan organisations
Where 52 cities + online See dates by city
Next start 16 Nov 2026 Course code SD-DA-113

Before you join: Participants should be comfortable writing and running basic Python scripts, including variables, functions, lists, dictionaries, loops, conditionals and file handling.

Dates & prices

Two start dates a month in every city, and live online on weekdays or weekends. Fees are per participant; classroom fees include tuition, materials, lunch and refreshments, and the certificate.

Suggest a date or city

Showing the next six months. Later dates, other cities and private deliveries for your team are available on request.

Course overview

Public websites, partner portals and internal web applications contain prices, procurement notices, regulatory updates, product specifications, service metrics and other operational data that often cannot be downloaded in a usable form. Analysts need repeatable ways to collect this information without relying on manual copy-and-paste, while respecting website terms, access controls, privacy obligations and data quality requirements. Poorly designed scrapers create unreliable datasets, overload websites, fail when page layouts change and expose organisations to avoidable legal and reputational risk.

This course teaches participants to design, build, test and maintain Python-based web data extraction workflows. Participants work with HTTP requests, HTML, CSS selectors, XPath, Beautiful Soup, Scrapy, browser automation and API endpoints. They extract structured records from static and JavaScript-rendered pages, manage pagination and session state, handle rate limits, validate extracted fields, store data in analytical formats and monitor scraper failures. The course also addresses ethical collection boundaries, robots.txt, consent, personal data and documentation.

Instruction combines short technical briefings with guided coding, realistic cases and peer review. Cases reflect common requirements such as monitoring public tenders, collecting bank branch information, tracking commodity prices, assembling NGO programme data and extracting product catalogues. Participants develop reusable extraction components from the first week, then deepen these into production-oriented workflows during the second week. They leave with a documented Python extraction project, including a source assessment, scraper design, data quality checks, scheduling plan and maintenance checklist.

The course suits analysts, data professionals, developers and technical researchers who already use Python and need dependable web-sourced datasets for reporting, research, market intelligence or operational analysis.

What you will be able to do

  • Assess website access, legal constraints and collection risks before building a scraper
  • Extract structured HTML data using Requests, Beautiful Soup, CSS selectors and XPath
  • Build Scrapy spiders that handle pagination, links, item pipelines and exports
  • Capture JavaScript-rendered content using Playwright browser automation and network inspection
  • Retrieve documented and undocumented JSON data through HTTP API requests
  • Validate, clean and standardise extracted records with pandas quality controls
  • Implement respectful collection controls using rate limits, retries, caching and logging
  • Present a documented end-to-end Python extraction workflow for a business data requirement

Benefits of attending

For you

  • Replace manual website copying with documented Python extraction workflows
  • Build a portfolio-quality scraper using professional data collection controls
  • Diagnose failed selectors, blocked requests and changing page structures
  • Produce cleaner web-derived datasets for analysis and reporting assignments
  • Explain lawful, ethical and respectful collection decisions to stakeholders

For your organisation

  • Reduce analyst time spent manually collecting recurring public web data
  • Create auditable extraction processes with source records and quality checks
  • Improve consistency of market, procurement and regulatory monitoring datasets
  • Reduce website disruption risks through controlled request rates and retries
  • Establish reusable Python patterns for future data collection requirements

Course modules

18 modules over 10 days

Participants can assess a web data requirement and define an appropriate collection approach.

  • Web scraping, crawling and API collection distinguished by data access method
  • Source requirements translated into fields, frequency, volume and output formats
  • Website terms, robots.txt and access controls assessed before collection
  • Personal data, copyright and database rights considered during source selection
  • Collection scope documented through a source assessment and extraction brief
  • Manual download, API access and scraping compared using decision criteria

Participants can create a reproducible Python project for web extraction work.

  • Virtual environments isolate package dependencies for extraction projects
  • Project folders separate source code, configuration, outputs and tests
  • requirements.txt records pinned package versions for repeatable installation
  • Environment variables protect tokens, credentials and local configuration values
  • Logging configuration records requests, errors, warnings and run summaries
  • Git commits capture meaningful changes to extraction code and documentation

Participants can retrieve web resources and inspect HTTP responses for extraction opportunities.

  • HTTP methods, status codes, headers and cookies explained through requests
  • Requests sessions preserve cookies and connection settings across calls
  • Query parameters filter server responses for targeted record retrieval
  • Response encoding and content types checked before parsing downloaded content
  • Redirect chains, timeout settings and exceptions handled explicitly
  • Developer tools reveal request URLs, payloads and response bodies

Participants can inspect page markup and write selectors that target required fields.

  • HTML elements, attributes and document hierarchy inspected in browser tools
  • CSS selectors target stable classes, attributes and structural relationships
  • XPath expressions select nodes using axes, predicates and text conditions
  • Selector specificity balanced against resilience to layout changes
  • Repeated record containers identified before extracting individual fields
  • Missing elements handled without failing complete extraction runs

Participants can extract structured records from static HTML pages using Beautiful Soup.

  • Beautiful Soup parses HTML into searchable tag objects
  • find, find_all and select retrieve targeted page elements
  • Text extraction removes whitespace, nested tags and unwanted labels
  • Attribute values capture links, identifiers, dates and image sources
  • Record dictionaries preserve consistent field names across extracted items
  • CSV and JSON exports store early extraction outputs for review

Participants can collect complete record sets across listing and detail pages.

  • Pagination patterns include page numbers, offsets, cursors and load-more links
  • Relative URLs converted into absolute links before follow-up requests
  • Listing pages provide identifiers and detail-page collection targets
  • URL deduplication prevents repeated retrieval of equivalent resources
  • Stop conditions detect final pages and empty result sets
  • Traversal logs record visited URLs, counts and failed detail requests

Participants can clean extracted values into analysis-ready data fields.

  • pandas DataFrames organise extracted records for inspection and transformation
  • Whitespace, Unicode characters and HTML entities cleaned consistently
  • Dates parsed with explicit formats, locales and timezone assumptions
  • Currency, percentages and quantities converted into numeric fields
  • Categorical labels standardised through mapping tables and controlled vocabularies
  • Duplicate records identified using keys, hashes and business rules

Participants can test web-derived datasets for completeness, validity and consistency.

  • Schema checks confirm expected fields, types and required values
  • Completeness metrics measure null rates across critical extracted fields
  • Range rules identify implausible prices, dates and quantities
  • Uniqueness tests detect repeated identifiers and duplicate records
  • Source snapshots preserve evidence for disputed extracted values
  • Quality exceptions logged for correction, exclusion or escalation

Participants can create Scrapy projects that organise crawling logic and extracted items.

  • Scrapy project structure separates spiders, items, pipelines and settings
  • Spider classes define start URLs, parsing methods and crawl rules
  • Item definitions specify expected fields for collected records
  • Request callbacks process responses and generate follow-up requests
  • Feed exports write items to JSON, CSV and JSON Lines
  • Scrapy shell tests selectors and responses before spider execution

Participants can build Scrapy spiders that collect, transform and export multi-page datasets.

  • Pagination requests follow next-page links through callback methods
  • Detail-page requests carry listing metadata using request meta values
  • Item loaders apply field processors during extraction and cleaning
  • Pipelines validate, transform and route completed scraped items
  • Duplicate filters prevent identical requests during recursive crawling
  • Spider settings control concurrency, delays, headers and output behaviour

Participants can identify where browser-rendered pages obtain their underlying data.

  • Client-side rendering distinguished from server-rendered HTML responses
  • Browser network panels identify XHR, fetch and GraphQL requests
  • JSON response payloads inspected for records, metadata and pagination
  • Request headers reveal required content types, origins and tokens
  • Embedded JSON state extracted from script tags and page source
  • Direct data endpoints preferred when authorised and technically suitable

Participants can automate browser interactions to extract authorised dynamic web content.

  • Playwright browsers load JavaScript-rendered pages and user interactions
  • Locator strategies target stable roles, labels and data attributes
  • Explicit waits replace unreliable fixed delays during page loading
  • Click, fill and select actions handle controlled user workflows
  • Downloaded files captured and stored with source metadata
  • Browser contexts isolate sessions, cookies and configuration settings

Participants can retrieve and normalise data from documented web APIs.

  • REST endpoints use resources, parameters and HTTP response conventions
  • API documentation identifies authentication, limits and pagination requirements
  • Bearer tokens and API keys loaded from environment variables
  • JSON payloads normalised into tabular records using pandas
  • Cursor pagination retrieves complete result sets without duplication
  • API errors classified using status codes and response messages

Participants can configure collection processes that minimise unnecessary load and access risk.

  • Rate limiting spaces requests according to source capacity and policies
  • Exponential backoff responds appropriately to temporary server failures
  • Retry rules distinguish recoverable errors from permanent failures
  • Caching reduces repeated downloads during development and testing
  • Conditional requests use ETags and Last-Modified response headers
  • Authentication boundaries respected without bypassing access restrictions

Participants can design operational controls for reliable recurring extraction jobs.

  • Structured logs capture run identifiers, counts, errors and durations
  • Assertions detect missing containers, changed labels and empty outputs
  • Unit tests verify parsers against saved HTML response fixtures
  • Data drift checks compare current outputs with historical distributions
  • Alert thresholds flag failed jobs and material record-count changes
  • Maintenance runbooks assign ownership, response steps and review frequency

Participants can prepare extracted data for recurring delivery to analytical users.

  • CSV, Parquet and JSON formats selected by downstream analytical needs
  • SQLite stores structured extraction outputs for local querying
  • File naming conventions preserve source, date and run identifiers
  • Scheduled jobs separate collection, transformation and publication steps
  • Incremental loads append new records while preserving historical data
  • Data dictionaries define fields, sources, transformations and refresh schedules

Participants can document an extraction solution and communicate its controls to stakeholders.

  • Extraction specifications define purpose, sources, fields and acceptance criteria
  • Data lineage records source URLs, transformations and output destinations
  • Risk registers document legal, technical and data quality concerns
  • Run metrics report volumes, failures, retries and completion times
  • Change control records selector updates, source changes and approvals
  • Stakeholder briefings explain collection limits, assumptions and refresh timing

Participants can build, review and present a complete documented Python web data extraction solution.

  • Source assessment defines authorised scope, fields and collection constraints
  • Python extractor collects records through appropriate HTTP or browser methods
  • Selectors, pagination and error handling produce complete structured outputs
  • Quality controls test completeness, validity, duplicates and data drift
  • Operational plan specifies scheduling, logging, alerts and maintenance ownership
  • Peer review evaluates code, documentation, ethics and business usefulness

Exercises and examples are adapted to each cohort's sectors and roles.

What you take back to work

  1. Web source assessment template
  2. Python extraction project structure
  3. Scrapy spider design pattern
  4. Data quality validation checklist
  5. Scraper monitoring runbook
  6. Documented capstone extraction solution

Who should attend

  • Data Analyst — needs repeatable web-sourced datasets for reporting and analysis
  • Business Intelligence Analyst — collects external market, competitor and operational information
  • Python Developer — builds maintainable extraction services and data pipelines
  • Market Research Analyst — gathers public evidence from distributed online sources
  • Risk and Compliance Analyst — monitors regulatory notices, sanctions lists and disclosures
  • Technical Researcher — converts web content into structured research datasets

Skills and tools covered

HTML data extractionScrapy spider developmentAPI data collectionBrowser automationData quality validationScraper operations

Tools and standards

Beautiful Soup, Scrapy, Playwright, pandas

How the course runs

Training methodology

The course uses short instructor briefings followed by guided coding, case analysis, group design reviews and individual build sessions. Participants inspect real page structures, write extraction logic, test selectors against changing content and compare alternative collection approaches. Cases include public procurement listings, regulatory notices, product catalogues and price-monitoring sources. Trainers use code reviews and troubleshooting simulations to address common failures such as pagination errors, blocked requests and malformed records. Each participant prepares an application plan for a suitable workplace data source.

Requirements and prerequisites

Participants should be comfortable writing and running basic Python scripts, including variables, functions, lists, dictionaries, loops, conditionals and file handling. They should understand CSV and JSON files and be able to install Python packages with pip. Prior exposure to pandas is useful but not essential. Participants should also be able to read simple HTML tags and attributes after an introductory explanation. No previous web scraping, Scrapy, browser automation, JavaScript, database administration or cloud deployment experience is required. This is not a suitable first Python programming course.

A typical training day

08:30 – 10:30First session
10:30 – 10:45Refreshment break
10:45 – 12:30Second session
12:30 – 13:30Lunch and networking
13:30 – 15:00Third session
15:00 – 15:15Refreshment break
15:15 – 16:30Workshop and daily review

Live online deliveries follow the same structure in East Africa Time, with shorter screen blocks and longer breaks.

What the fee includes

  • Instruction by a practitioner facilitator
  • Full course workbook and materials
  • Exercise files, templates and case studies
  • Refreshments and lunch on classroom deliveries
  • Certificate of completion
  • Post-course application plan

Frequently asked questions

You should be able to write basic Python scripts using functions, loops, dictionaries and files. The course teaches scraping libraries and techniques from the ground up, but it does not teach Python programming fundamentals.

Bring a laptop on which you can install Python packages and use a code editor. Access to a suitable browser is required for inspecting page structure and network requests.

It is designed for analysts, developers, researchers and technical professionals who need structured data from authorised web sources. It is particularly useful where recurring manual collection consumes substantial analyst time.

Data analysis courses focus mainly on cleaning, analysing and visualising datasets that already exist. This course focuses on obtaining web-based data reliably, then applies targeted cleaning and validation methods to make those records usable.

Yes, provided the source can be discussed and accessed within its terms, permissions and confidentiality requirements. Participants prepare an application plan and can adapt the capstone approach to an approved business requirement.

The first week establishes HTTP, HTML, selector, Beautiful Soup, data quality and Scrapy foundations through practical coding. The second week covers dynamic pages, APIs, responsible collection, operations, documentation and the final capstone presentation.

Questions about this course?

Ask about dates, fees, group bookings or running it for your team. Our training team replies by email.