Join Joe Marini for an in-depth discussion in this video Parsing and processing HTML, part of Up and Running with Python.
Python provides a built-in way for parsing html data as well as other kinds of data.…In this example we're going to see how to create our own html parser based on the…html parser class that Python provides. So, here in the example snippets I'll…scroll down to the html section in chapter five.…So, let's go ahead htmlparsing_start.py. Now, you can see what I've done here is…I've created a function called name and I've got a variable here called parser and…I'm stantiating a myHTMLParser class. So, we're going to write that class and…feed it some html and then watch as it parses the information.…
So, lets go back to the snippets. Okay.…So, before we do anything else let's scroll down here to line 513.…What we're going to do is copy lines 513 to 517, and we're going to go back to the…main file and we're going to paste that. Here, into the main function.…Now, we could use the URL lib to open up a URL and read the HTML data straight from…the URL, but I'm not going to do that. In this case, I'm going to just simply…
- Installing Python
- Choosing an editor/IDE
- Working with variables and expressions
- Writing loops
- Using the date, time, and datetime classes
- Reading and writing files
- Fetching Internet data
- Parsing and processing HTML
Skill Level Beginner
1. Preparing the Development Environment
2. Python Basics
3. Working with Dates and Times
4. Working with Files
5. Working with Web Data
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.