发布时间:2022-08-09 文章分类:编程知识 投稿人:赵颖 字号: 默认 | | 超大 打印

urlgrabber

urlgrabber is a pure python package that drastically simplifies
the fetching of files. It is designed to be used in programs
that need common (but not necessarily simple) url-fetching
features. It is extremely simple to drop into an existing
program and provides a clean interface to protocol-independant
file-access. Best of all, urlgrabber takes care of all those
pesky file-fetching details, and lets you focus on whatever it
is that your program is written to do!

urlgrabber came into existence as the part of yum that
downloads rpms and header files, but it quickly became clear
that this is a general problem that many applications must deal
with.

Features

Using urlgrabber, data can be fetched in three basic ways:

urlgrab(url) copy the file to the local filesystem
urlopen(url) open the remote file and return a file object
urlread(url) return the contents of the file as a string

When using these functions (or methods), urlgrabber supports the
following features:

Not sure if urlgrabber is the tool for you? Check out our comparison of the major options.

Documentation, Examples, and Help

There are many sources of urlgrabber-related assistance and
information