From the course: Python: XML, JSON, and the Web

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Drawbacks of urllib

Drawbacks of urllib - Python Tutorial

From the course: Python: XML, JSON, and the Web

Start my 1-month free trial

Drawbacks of urllib

- [Instructor] The urllib module is relatively simple and easy to use, but it does have several drawbacks when compared to other libraries that are available. So I'll cover some of the most important ones here and in the next chapter we'll learn about another module that solves some of these challenges. First, urllib only supports a subset of the full set of HTTP operations, such as get and post, unless you implement them yourself. Now it's probably not that often that you'll need to use the patch or delete methods of HTTP but if you do then it would be nice to have a library that supports them for you. As we saw in the first example of the chapter, urllib does not automatically decode the returned data for you. Now in our example this wasn't a big issue because we knew the encoding format of the data that would be returned in advance, but if you're writing an app that has to deal with unknown data sources or multiple encodings then that becomes pretty tedious pretty quickly. There…

Contents