Pulling out the individual data points

Now that we have all the divs with our listing data for each apartment, we need to pull out the individual data points for each apartments.

These are the points in each that we want to target:

  • URL of the listing
  • Address of the apartment
  • Neighborhood
  • Number of bedrooms
  • Number of bathrooms

Obviously, we love to have way more info—things such as square footage, for example, but we'll have to make do with what we have.

Let's begin by looking at the first listing:

listing_divs[0] 

The preceding code results in the following output:

Notice that this first div contains all of the data points we were looking ...

Get Python Machine Learning Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.