Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical Data Analysis Cookbook

You're reading from   Practical Data Analysis Cookbook Over 60 practical recipes on data exploration and analysis

Arrow left icon
Product type Paperback
Published in Apr 2016
Publisher
ISBN-13 9781783551668
Length 384 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Tomasz Drabas Tomasz Drabas
Author Profile Icon Tomasz Drabas
Tomasz Drabas
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Preparing the Data FREE CHAPTER 2. Exploring the Data 3. Classification Techniques 4. Clustering Techniques 5. Reducing Dimensions 6. Regression Methods 7. Time Series Techniques 8. Graphs 9. Natural Language Processing 10. Discrete Choice Models 11. Simulations Index

Reading raw text from the Web


Most of the times, the free-form text can be found in text files; in this recipe, we will not be teaching you how to do that as we have already presented many ways of doing so. (Refer to the set of recipes in Chapter 1, Preparing the Data.)

Note

One way of reading a file that we have not explored yet will be discussed in the next recipe.

Many times, however, we need to read data straight from the web: we might want to analyze a blog post, scrape an article, or analyze Facebook or Twitter posts. While Facebook and Twitter offer Application Programming Interfaces (APIs) that normally return answers in XML or JSON formats, processing HTML files is not as straightforward.

In this recipe, you will learn how to access a web page, read its content, and process it.

Getting ready

To execute this recipe, you will need urllib, html5lib, and Beautiful Soup.

Urllib comes with Python 3 (https://docs.python.org/3/library/urllib.html). If, however, your configuration does not have...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime