How to do it

We proceed with the recipe as follows:

  1. The code of the API for this recipe is in 09/03/api.py. This script adds an additional class, JobListingSkills, with the following implementation:
class JobListingSkills(Resource):    def get(self, job_listing_id):        print("Request for job listing's skills with id: " + job_listing_id)        skills = get_job_listing_skills(job_listing_id)        print("Got the following skills as a response: " + skills)        return skills
This implementation is similar to that of the previous recipe, except that it calls the new function for getting skills.
  1. We still need to add a statement to inform Flask-RESTful how to map URLs to this classes' get method.  Since we are actually looking at retrieving a sub-property of the larger ...

Get Python Web Scraping Cookbook 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.