- [Instructor] Sometimes when you're…processing structured data like XML or HTML,…you don't want to build a parser…that just runs through the document one line at a time.…What you'll need to do is have the entire document…in memory, and this usually happens when you want…to edit the document's contents, and manipulate it at will.…You don't want to have to run through the file…line-by-line every time.…So what you'll need to do is operate on the document's DOM.…In this example, we'll see how to use the XML miniDOM class…that Python provides, to load an XML file…and then operate on the document while it's in memory.…
So let's begin by opening the xmlparsing_start file.…And the first thing I'm going to do is import the module…that lets me operate on an XML DOM.…So I'll write import xml.dom.minidom.…So the XML file I'm going to be parsing,…is this one over here named samplexml.xml.…So if you open it up and look at it,…you can see it's a pretty standard XML file.…It's just got some basic information about a person in it,…
- Installing Python
- Choosing an editor or 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. Getting Started
2. Python Basics
3. Working with Dates and Time
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.