Skip to main content
  • Book
  • © 2018

Practical Web Scraping for Data Science

Best Practices and Examples with Python

Apress
  • Web scraping geared toward data scientists that explains how web scraping fits into the data science workflow
  • Takes a “code first” approach to get you up to speed quickly without too much boilerplate text
  • Includes many larger, fully worked out examples

Buy it now

Buying options

eBook USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access

This is a preview of subscription content, log in via an institution to check for access.

Table of contents (9 chapters)

  1. Front Matter

    Pages i-xvi
  2. Web Scraping Basics

    1. Front Matter

      Pages 1-1
    2. Introduction

      • Seppe vanden Broucke, Bart Baesens
      Pages 3-23
    3. The Web Speaks HTTP

      • Seppe vanden Broucke, Bart Baesens
      Pages 25-48
    4. Stirring the HTML and CSS Soup

      • Seppe vanden Broucke, Bart Baesens
      Pages 49-77
  3. Advanced Web Scraping

    1. Front Matter

      Pages 79-79
    2. Delving Deeper in HTTP

      • Seppe vanden Broucke, Bart Baesens
      Pages 81-126
    3. Dealing with JavaScript

      • Seppe vanden Broucke, Bart Baesens
      Pages 127-154
    4. From Web Scraping to Web Crawling

      • Seppe vanden Broucke, Bart Baesens
      Pages 155-172
  4. Managerial Concerns and Best Practices

    1. Front Matter

      Pages 173-173
    2. Managerial and Legal Concerns

      • Seppe vanden Broucke, Bart Baesens
      Pages 175-186
    3. Closing Topics

      • Seppe vanden Broucke, Bart Baesens
      Pages 187-195
    4. Examples

      • Seppe vanden Broucke, Bart Baesens
      Pages 197-298
  5. Back Matter

    Pages 299-306

About this book

This book provides a complete and modern guide to web scraping, using Python as the programming language, without glossing over important details or best practices. Written with a data science audience in mind, the book explores both scraping and the larger context of web technologies in which it operates, to ensure full understanding. The authors recommend web scraping as a powerful tool for any data scientist’s arsenal, as many data science projects start by obtaining an appropriate data set.

Starting with a brief overview on scraping and real-life use cases, the authors explore the core concepts of HTTP, HTML, and CSS to provide a solid foundation. Along with a quick Python primer, they cover Selenium for JavaScript-heavy sites, and web crawling in detail. The book finishes with a recap of best practices and a collection of examples that bring together everything you've learned and illustrate various data science use cases.

What You'll Learn

  • Leverage well-established best practices and commonly-used Python packages
  • Handle today's web, including JavaScript, cookies, and common web scraping mitigation techniques
  • Understand the managerial and legal concerns regarding web scraping
Who This Book is For


A data science oriented audience that is probably already familiar with Python or another programming language or analytical toolkit (R, SAS, SPSS, etc). Students or instructors in university courses may also benefit. Readers unfamiliar with Python will appreciate a quick Python primer in chapter 1 to catch up with the basics and provide pointers to other guides as well.

Authors and Affiliations

  • KU Leuven, Leuven, Belgium

    Seppe vanden Broucke

  • Dept of Decision Sci & Info Managem, KU Leuven Dept of Decision Sci & Info Managem, Leuven, Belgium

    Bart Baesens

About the authors

Seppe vanden Broucke is an assistant professor of data and process science at the Faculty of Economics and Business, KU Leuven, Belgium. His research interests include business data mining and analytics, machine learning, process management, and process mining. His work has been published in well-known international journals and presented at top conferences. Seppe’s teaching includes Advanced Analytics, Big Data and Information Management courses. He also frequently teaches for industry and business audiences. Besides work, Seppe enjoys travelling, reading (Murakami to Bukowski to Asimov), listening to music (Booka Shade to Miles Davis to Claude Debussy), watching movies and series (less so these days due to a lack of time), gaming, and keeping up with the news.

Bart Baesens is a professor of big data and analytics at KU Leuven, Belgium, and a lecturer at the University of Southampton, United Kingdom. He has done extensive research on big data and analytics, credit risk modeling, fraud detection and marketing analytics. Bart has written more than 200 scientific papers and several books. Besides enjoying time with his family, he is also a diehard Club Brugge soccer fan. Bart is a foodie and amateur cook. He loves drinking a good glass of wine (his favorites are white Viognier or red Cabernet Sauvignon) either in his wine cellar or when overlooking the authentic red English phone booth in his garden. Bart loves traveling and is fascinated by World War I and reads many books on the topic.

Bibliographic Information

Buy it now

Buying options

eBook USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access