O'Reilly logo

Python Web Scraping Cookbook by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

The code for this example is in the 07/13_clean_jd.py file.  It continues on where the 07/12_scrape_job_stackoverflow.py file ends:

  1. We start by creating a BeautifulSoup object from the description key of the description we loaded.  We will also print this to see what it looks like:
desc_bs = BeautifulSoup(job_listing_contents["description"], "lxml")print(desc_bs)<p><span>Location options: <strong>Paid relocation</strong></span><br/><span>Job type: <strong>Permanent</strong></span><br/><span>Experience level: <strong>Mid-Level, Senior</strong></span><br/><span>Role: <strong>Full Stack Developer</strong></span><br/><span>Industry: <strong>Aerospace, Information Technology, Web Development</strong></span><br/><span>Company ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required