Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="module-httplib.html" /> | |
13 | <link rel="prev" href="module-urllib.html" /> | |
14 | <link rel="parent" href="internet.html" /> | |
15 | <link rel="next" href="request-objects.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>11.5 urllib2 -- extensible library for opening URLs</title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="11.4.2 Examples" | |
25 | href="node483.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="11. Internet Protocols and" | |
28 | href="internet.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="11.5.1 Request Objects" | |
31 | href="request-objects.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="node483.html">11.4.2 Examples</A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="internet.html">11. Internet Protocols and</A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="request-objects.html">11.5.1 Request Objects</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H1><A NAME="SECTION0013500000000000000000"> | |
56 | 11.5 <tt class="module">urllib2</tt> -- | |
57 | extensible library for opening URLs</A> | |
58 | </H1> | |
59 | ||
60 | <P> | |
61 | <A NAME="module-urllib2"></A> | |
62 | ||
63 | <P> | |
64 | ||
65 | <P> | |
66 | The <tt class="module">urllib2</tt> module defines functions and classes which help | |
67 | in opening URLs (mostly HTTP) in a complex world -- basic and digest | |
68 | authentication, redirections, cookies and more. | |
69 | ||
70 | <P> | |
71 | The <tt class="module">urllib2</tt> module defines the following functions: | |
72 | ||
73 | <P> | |
74 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
75 | <td><nobr><b><tt id='l2h-3218' xml:id='l2h-3218' class="function">urlopen</tt></b>(</nobr></td> | |
76 | <td><var>url</var><big>[</big><var>, data</var><big>]</big><var></var>)</td></tr></table></dt> | |
77 | <dd> | |
78 | Open the URL <var>url</var>, which can be either a string or a <tt class="class">Request</tt> | |
79 | object. | |
80 | ||
81 | <P> | |
82 | <var>data</var> should be a string, which specifies additional data to | |
83 | send to the server. In HTTP requests, which are the only ones that | |
84 | support <var>data</var>, it should be a buffer in the format of | |
85 | <span class="mimetype">application/x-www-form-urlencoded</span>, for example one returned | |
86 | from <tt class="function">urllib.urlencode()</tt>. | |
87 | ||
88 | <P> | |
89 | This function returns a file-like object with two additional methods: | |
90 | ||
91 | <P> | |
92 | ||
93 | <UL> | |
94 | <LI><tt class="method">geturl()</tt> -- return the URL of the resource retrieved | |
95 | </LI> | |
96 | <LI><tt class="method">info()</tt> -- return the meta-information of the page, as | |
97 | a dictionary-like object | |
98 | </LI> | |
99 | </UL> | |
100 | ||
101 | <P> | |
102 | Raises <tt class="exception">URLError</tt> on errors. | |
103 | ||
104 | <P> | |
105 | Note that <code>None</code> may be returned if no handler handles the | |
106 | request (though the default installed global <tt class="class">OpenerDirector</tt> | |
107 | uses <tt class="class">UnknownHandler</tt> to ensure this never happens). | |
108 | </dl> | |
109 | ||
110 | <P> | |
111 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
112 | <td><nobr><b><tt id='l2h-3219' xml:id='l2h-3219' class="function">install_opener</tt></b>(</nobr></td> | |
113 | <td><var>opener</var>)</td></tr></table></dt> | |
114 | <dd> | |
115 | Install an <tt class="class">OpenerDirector</tt> instance as the default global | |
116 | opener. Installing an opener is only necessary if you want urlopen to | |
117 | use that opener; otherwise, simply call <tt class="method">OpenerDirector.open()</tt> | |
118 | instead of <tt class="function">urlopen()</tt>. The code does not check for a real | |
119 | <tt class="class">OpenerDirector</tt>, and any class with the appropriate interface | |
120 | will work. | |
121 | </dl> | |
122 | ||
123 | <P> | |
124 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
125 | <td><nobr><b><tt id='l2h-3220' xml:id='l2h-3220' class="function">build_opener</tt></b>(</nobr></td> | |
126 | <td><var></var><big>[</big><var>handler, ...</var><big>]</big><var></var>)</td></tr></table></dt> | |
127 | <dd> | |
128 | Return an <tt class="class">OpenerDirector</tt> instance, which chains the | |
129 | handlers in the order given. <var>handler</var>s can be either instances | |
130 | of <tt class="class">BaseHandler</tt>, or subclasses of <tt class="class">BaseHandler</tt> (in | |
131 | which case it must be possible to call the constructor without | |
132 | any parameters). Instances of the following classes will be in | |
133 | front of the <var>handler</var>s, unless the <var>handler</var>s contain | |
134 | them, instances of them or subclasses of them: | |
135 | <tt class="class">ProxyHandler</tt>, <tt class="class">UnknownHandler</tt>, <tt class="class">HTTPHandler</tt>, | |
136 | <tt class="class">HTTPDefaultErrorHandler</tt>, <tt class="class">HTTPRedirectHandler</tt>, | |
137 | <tt class="class">FTPHandler</tt>, <tt class="class">FileHandler</tt>, <tt class="class">HTTPErrorProcessor</tt>. | |
138 | ||
139 | <P> | |
140 | If the Python installation has SSL support (<tt class="function">socket.ssl()</tt> | |
141 | exists), <tt class="class">HTTPSHandler</tt> will also be added. | |
142 | ||
143 | <P> | |
144 | Beginning in Python 2.3, a <tt class="class">BaseHandler</tt> subclass may also | |
145 | change its <tt class="member">handler_order</tt> member variable to modify its | |
146 | position in the handlers list. Besides <tt class="class">ProxyHandler</tt>, which has | |
147 | <tt class="member">handler_order</tt> of <code>100</code>, all handlers currently have it | |
148 | set to <code>500</code>. | |
149 | </dl> | |
150 | ||
151 | <P> | |
152 | The following exceptions are raised as appropriate: | |
153 | ||
154 | <P> | |
155 | <dl><dt><b><span class="typelabel">exception</span> <tt id='l2h-3221' xml:id='l2h-3221' class="exception">URLError</tt></b></dt> | |
156 | <dd> | |
157 | The handlers raise this exception (or derived exceptions) when they | |
158 | run into a problem. It is a subclass of <tt class="exception">IOError</tt>. | |
159 | </dd></dl> | |
160 | ||
161 | <P> | |
162 | <dl><dt><b><span class="typelabel">exception</span> <tt id='l2h-3222' xml:id='l2h-3222' class="exception">HTTPError</tt></b></dt> | |
163 | <dd> | |
164 | A subclass of <tt class="exception">URLError</tt>, it can also function as a | |
165 | non-exceptional file-like return value (the same thing that | |
166 | <tt class="function">urlopen()</tt> returns). This is useful when handling exotic | |
167 | HTTP errors, such as requests for authentication. | |
168 | </dd></dl> | |
169 | ||
170 | <P> | |
171 | <dl><dt><b><span class="typelabel">exception</span> <tt id='l2h-3223' xml:id='l2h-3223' class="exception">GopherError</tt></b></dt> | |
172 | <dd> | |
173 | A subclass of <tt class="exception">URLError</tt>, this is the error raised by the | |
174 | Gopher handler. | |
175 | </dd></dl> | |
176 | ||
177 | <P> | |
178 | The following classes are provided: | |
179 | ||
180 | <P> | |
181 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
182 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3224' xml:id='l2h-3224' class="class">Request</tt></b>(</nobr></td> | |
183 | <td><var>url</var><big>[</big><var>, data</var><big>]</big><var></var><big>[</big><var>, headers</var><big>]</big><var> | |
184 | </var><big>[</big><var>, origin_req_host</var><big>]</big><var></var><big>[</big><var>, unverifiable</var><big>]</big><var></var>)</td></tr></table></dt> | |
185 | <dd> | |
186 | This class is an abstraction of a URL request. | |
187 | ||
188 | <P> | |
189 | <var>url</var> should be a string which is a valid URL. For a description | |
190 | of <var>data</var> see the <tt class="method">add_data()</tt> description. | |
191 | <var>headers</var> should be a dictionary, and will be treated as if | |
192 | <tt class="method">add_header()</tt> was called with each key and value as arguments. | |
193 | ||
194 | <P> | |
195 | The final two arguments are only of interest for correct handling of | |
196 | third-party HTTP cookies: | |
197 | ||
198 | <P> | |
199 | <var>origin_req_host</var> should be the request-host of the origin | |
200 | transaction, as defined by <a class="rfc" id='rfcref-89986' xml:id='rfcref-89986' | |
201 | href="http://www.faqs.org/rfcs/rfc2965.html">RFC 2965</a>. It defaults to | |
202 | <code>cookielib.request_host(self)</code>. This is the host name or IP | |
203 | address of the original request that was initiated by the user. For | |
204 | example, if the request is for an image in an HTML document, this | |
205 | should be the request-host of the request for the page containing the | |
206 | image. | |
207 | ||
208 | <P> | |
209 | <var>unverifiable</var> should indicate whether the request is | |
210 | unverifiable, as defined by RFC 2965. It defaults to False. An | |
211 | unverifiable request is one whose URL the user did not have the option | |
212 | to approve. For example, if the request is for an image in an HTML | |
213 | document, and the user had no option to approve the automatic fetching | |
214 | of the image, this should be true. | |
215 | </dl> | |
216 | ||
217 | <P> | |
218 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
219 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3225' xml:id='l2h-3225' class="class">OpenerDirector</tt></b>(</nobr></td> | |
220 | <td><var></var>)</td></tr></table></dt> | |
221 | <dd> | |
222 | The <tt class="class">OpenerDirector</tt> class opens URLs via <tt class="class">BaseHandler</tt>s | |
223 | chained together. It manages the chaining of handlers, and recovery | |
224 | from errors. | |
225 | </dl> | |
226 | ||
227 | <P> | |
228 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
229 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3226' xml:id='l2h-3226' class="class">BaseHandler</tt></b>(</nobr></td> | |
230 | <td><var></var>)</td></tr></table></dt> | |
231 | <dd> | |
232 | This is the base class for all registered handlers -- and handles only | |
233 | the simple mechanics of registration. | |
234 | </dl> | |
235 | ||
236 | <P> | |
237 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
238 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3227' xml:id='l2h-3227' class="class">HTTPDefaultErrorHandler</tt></b>(</nobr></td> | |
239 | <td><var></var>)</td></tr></table></dt> | |
240 | <dd> | |
241 | A class which defines a default handler for HTTP error responses; all | |
242 | responses are turned into <tt class="exception">HTTPError</tt> exceptions. | |
243 | </dl> | |
244 | ||
245 | <P> | |
246 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
247 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3228' xml:id='l2h-3228' class="class">HTTPRedirectHandler</tt></b>(</nobr></td> | |
248 | <td><var></var>)</td></tr></table></dt> | |
249 | <dd> | |
250 | A class to handle redirections. | |
251 | </dl> | |
252 | ||
253 | <P> | |
254 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
255 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3229' xml:id='l2h-3229' class="class">HTTPCookieProcessor</tt></b>(</nobr></td> | |
256 | <td><var></var><big>[</big><var>cookiejar</var><big>]</big><var></var>)</td></tr></table></dt> | |
257 | <dd> | |
258 | A class to handle HTTP Cookies. | |
259 | </dl> | |
260 | ||
261 | <P> | |
262 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
263 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3230' xml:id='l2h-3230' class="class">ProxyHandler</tt></b>(</nobr></td> | |
264 | <td><var></var><big>[</big><var>proxies</var><big>]</big><var></var>)</td></tr></table></dt> | |
265 | <dd> | |
266 | Cause requests to go through a proxy. | |
267 | If <var>proxies</var> is given, it must be a dictionary mapping | |
268 | protocol names to URLs of proxies. | |
269 | The default is to read the list of proxies from the environment | |
270 | variables <a class="envvar" id='l2h-3246' xml:id='l2h-3246'><protocol>_proxy</a>. | |
271 | </dl> | |
272 | ||
273 | <P> | |
274 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
275 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3231' xml:id='l2h-3231' class="class">HTTPPasswordMgr</tt></b>(</nobr></td> | |
276 | <td><var></var>)</td></tr></table></dt> | |
277 | <dd> | |
278 | Keep a database of | |
279 | <code>(<var>realm</var>, <var>uri</var>) -> (<var>user</var>, <var>password</var>)</code> | |
280 | mappings. | |
281 | </dl> | |
282 | ||
283 | <P> | |
284 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
285 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3232' xml:id='l2h-3232' class="class">HTTPPasswordMgrWithDefaultRealm</tt></b>(</nobr></td> | |
286 | <td><var></var>)</td></tr></table></dt> | |
287 | <dd> | |
288 | Keep a database of | |
289 | <code>(<var>realm</var>, <var>uri</var>) -> (<var>user</var>, <var>password</var>)</code> mappings. | |
290 | A realm of <code>None</code> is considered a catch-all realm, which is searched | |
291 | if no other realm fits. | |
292 | </dl> | |
293 | ||
294 | <P> | |
295 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
296 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3233' xml:id='l2h-3233' class="class">AbstractBasicAuthHandler</tt></b>(</nobr></td> | |
297 | <td><var></var><big>[</big><var>password_mgr</var><big>]</big><var></var>)</td></tr></table></dt> | |
298 | <dd> | |
299 | This is a mixin class that helps with HTTP authentication, both | |
300 | to the remote host and to a proxy. | |
301 | <var>password_mgr</var>, if given, should be something that is compatible | |
302 | with <tt class="class">HTTPPasswordMgr</tt>; refer to section <A href="http-password-mgr.html#http-password-mgr">11.5.7</A> | |
303 | for information on the interface that must be supported. | |
304 | </dl> | |
305 | ||
306 | <P> | |
307 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
308 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3234' xml:id='l2h-3234' class="class">HTTPBasicAuthHandler</tt></b>(</nobr></td> | |
309 | <td><var></var><big>[</big><var>password_mgr</var><big>]</big><var></var>)</td></tr></table></dt> | |
310 | <dd> | |
311 | Handle authentication with the remote host. | |
312 | <var>password_mgr</var>, if given, should be something that is compatible | |
313 | with <tt class="class">HTTPPasswordMgr</tt>; refer to section <A href="http-password-mgr.html#http-password-mgr">11.5.7</A> | |
314 | for information on the interface that must be supported. | |
315 | </dl> | |
316 | ||
317 | <P> | |
318 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
319 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3235' xml:id='l2h-3235' class="class">ProxyBasicAuthHandler</tt></b>(</nobr></td> | |
320 | <td><var></var><big>[</big><var>password_mgr</var><big>]</big><var></var>)</td></tr></table></dt> | |
321 | <dd> | |
322 | Handle authentication with the proxy. | |
323 | <var>password_mgr</var>, if given, should be something that is compatible | |
324 | with <tt class="class">HTTPPasswordMgr</tt>; refer to section <A href="http-password-mgr.html#http-password-mgr">11.5.7</A> | |
325 | for information on the interface that must be supported. | |
326 | </dl> | |
327 | ||
328 | <P> | |
329 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
330 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3236' xml:id='l2h-3236' class="class">AbstractDigestAuthHandler</tt></b>(</nobr></td> | |
331 | <td><var></var><big>[</big><var>password_mgr</var><big>]</big><var></var>)</td></tr></table></dt> | |
332 | <dd> | |
333 | This is a mixin class that helps with HTTP authentication, both | |
334 | to the remote host and to a proxy. | |
335 | <var>password_mgr</var>, if given, should be something that is compatible | |
336 | with <tt class="class">HTTPPasswordMgr</tt>; refer to section <A href="http-password-mgr.html#http-password-mgr">11.5.7</A> | |
337 | for information on the interface that must be supported. | |
338 | </dl> | |
339 | ||
340 | <P> | |
341 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
342 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3237' xml:id='l2h-3237' class="class">HTTPDigestAuthHandler</tt></b>(</nobr></td> | |
343 | <td><var></var><big>[</big><var>password_mgr</var><big>]</big><var></var>)</td></tr></table></dt> | |
344 | <dd> | |
345 | Handle authentication with the remote host. | |
346 | <var>password_mgr</var>, if given, should be something that is compatible | |
347 | with <tt class="class">HTTPPasswordMgr</tt>; refer to section <A href="http-password-mgr.html#http-password-mgr">11.5.7</A> | |
348 | for information on the interface that must be supported. | |
349 | </dl> | |
350 | ||
351 | <P> | |
352 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
353 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3238' xml:id='l2h-3238' class="class">ProxyDigestAuthHandler</tt></b>(</nobr></td> | |
354 | <td><var></var><big>[</big><var>password_mgr</var><big>]</big><var></var>)</td></tr></table></dt> | |
355 | <dd> | |
356 | Handle authentication with the proxy. | |
357 | <var>password_mgr</var>, if given, should be something that is compatible | |
358 | with <tt class="class">HTTPPasswordMgr</tt>; refer to section <A href="http-password-mgr.html#http-password-mgr">11.5.7</A> | |
359 | for information on the interface that must be supported. | |
360 | </dl> | |
361 | ||
362 | <P> | |
363 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
364 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3239' xml:id='l2h-3239' class="class">HTTPHandler</tt></b>(</nobr></td> | |
365 | <td><var></var>)</td></tr></table></dt> | |
366 | <dd> | |
367 | A class to handle opening of HTTP URLs. | |
368 | </dl> | |
369 | ||
370 | <P> | |
371 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
372 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3240' xml:id='l2h-3240' class="class">HTTPSHandler</tt></b>(</nobr></td> | |
373 | <td><var></var>)</td></tr></table></dt> | |
374 | <dd> | |
375 | A class to handle opening of HTTPS URLs. | |
376 | </dl> | |
377 | ||
378 | <P> | |
379 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
380 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3241' xml:id='l2h-3241' class="class">FileHandler</tt></b>(</nobr></td> | |
381 | <td><var></var>)</td></tr></table></dt> | |
382 | <dd> | |
383 | Open local files. | |
384 | </dl> | |
385 | ||
386 | <P> | |
387 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
388 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3242' xml:id='l2h-3242' class="class">FTPHandler</tt></b>(</nobr></td> | |
389 | <td><var></var>)</td></tr></table></dt> | |
390 | <dd> | |
391 | Open FTP URLs. | |
392 | </dl> | |
393 | ||
394 | <P> | |
395 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
396 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3243' xml:id='l2h-3243' class="class">CacheFTPHandler</tt></b>(</nobr></td> | |
397 | <td><var></var>)</td></tr></table></dt> | |
398 | <dd> | |
399 | Open FTP URLs, keeping a cache of open FTP connections to minimize | |
400 | delays. | |
401 | </dl> | |
402 | ||
403 | <P> | |
404 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
405 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3244' xml:id='l2h-3244' class="class">GopherHandler</tt></b>(</nobr></td> | |
406 | <td><var></var>)</td></tr></table></dt> | |
407 | <dd> | |
408 | Open gopher URLs. | |
409 | </dl> | |
410 | ||
411 | <P> | |
412 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
413 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-3245' xml:id='l2h-3245' class="class">UnknownHandler</tt></b>(</nobr></td> | |
414 | <td><var></var>)</td></tr></table></dt> | |
415 | <dd> | |
416 | A catch-all class to handle unknown URLs. | |
417 | </dl> | |
418 | ||
419 | <P> | |
420 | ||
421 | <p><br /></p><hr class='online-navigation' /> | |
422 | <div class='online-navigation'> | |
423 | <!--Table of Child-Links--> | |
424 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> | |
425 | ||
426 | <UL CLASS="ChildLinks"> | |
427 | <LI><A href="request-objects.html">11.5.1 Request Objects</a> | |
428 | <LI><A href="opener-director-objects.html">11.5.2 OpenerDirector Objects</a> | |
429 | <LI><A href="base-handler-objects.html">11.5.3 BaseHandler Objects</a> | |
430 | <LI><A href="http-redirect-handler.html">11.5.4 HTTPRedirectHandler Objects</a> | |
431 | <LI><A href="http-cookie-processor.html">11.5.5 HTTPCookieProcessor Objects</a> | |
432 | <LI><A href="proxy-handler.html">11.5.6 ProxyHandler Objects</a> | |
433 | <LI><A href="http-password-mgr.html">11.5.7 HTTPPasswordMgr Objects</a> | |
434 | <LI><A href="abstract-basic-auth-handler.html">11.5.8 AbstractBasicAuthHandler Objects</a> | |
435 | <LI><A href="http-basic-auth-handler.html">11.5.9 HTTPBasicAuthHandler Objects</a> | |
436 | <LI><A href="proxy-basic-auth-handler.html">11.5.10 ProxyBasicAuthHandler Objects</a> | |
437 | <LI><A href="abstract-digest-auth-handler.html">11.5.11 AbstractDigestAuthHandler Objects</a> | |
438 | <LI><A href="http-digest-auth-handler.html">11.5.12 HTTPDigestAuthHandler Objects</a> | |
439 | <LI><A href="proxy-digest-auth-handler.html">11.5.13 ProxyDigestAuthHandler Objects</a> | |
440 | <LI><A href="http-handler-objects.html">11.5.14 HTTPHandler Objects</a> | |
441 | <LI><A href="https-handler-objects.html">11.5.15 HTTPSHandler Objects</a> | |
442 | <LI><A href="file-handler-objects.html">11.5.16 FileHandler Objects</a> | |
443 | <LI><A href="ftp-handler-objects.html">11.5.17 FTPHandler Objects</a> | |
444 | <LI><A href="cacheftp-handler-objects.html">11.5.18 CacheFTPHandler Objects</a> | |
445 | <LI><A href="gopher-handler.html">11.5.19 GopherHandler Objects</a> | |
446 | <LI><A href="unknown-handler-objects.html">11.5.20 UnknownHandler Objects</a> | |
447 | <LI><A href="http-error-processor-objects.html">11.5.21 HTTPErrorProcessor Objects</a> | |
448 | <LI><A href="urllib2-examples.html">11.5.22 Examples</a> | |
449 | </ul> | |
450 | <!--End of Table of Child-Links--> | |
451 | </div> | |
452 | ||
453 | <DIV CLASS="navigation"> | |
454 | <div class='online-navigation'> | |
455 | <p></p><hr /> | |
456 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
457 | <tr> | |
458 | <td class='online-navigation'><a rel="prev" title="11.4.2 Examples" | |
459 | href="node483.html"><img src='../icons/previous.png' | |
460 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
461 | <td class='online-navigation'><a rel="parent" title="11. Internet Protocols and" | |
462 | href="internet.html"><img src='../icons/up.png' | |
463 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
464 | <td class='online-navigation'><a rel="next" title="11.5.1 Request Objects" | |
465 | href="request-objects.html"><img src='../icons/next.png' | |
466 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
467 | <td align="center" width="100%">Python Library Reference</td> | |
468 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
469 | href="contents.html"><img src='../icons/contents.png' | |
470 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
471 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
472 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
473 | <td class='online-navigation'><a rel="index" title="Index" | |
474 | href="genindex.html"><img src='../icons/index.png' | |
475 | border='0' height='32' alt='Index' width='32' /></A></td> | |
476 | </tr></table> | |
477 | <div class='online-navigation'> | |
478 | <b class="navlabel">Previous:</b> | |
479 | <a class="sectref" rel="prev" href="node483.html">11.4.2 Examples</A> | |
480 | <b class="navlabel">Up:</b> | |
481 | <a class="sectref" rel="parent" href="internet.html">11. Internet Protocols and</A> | |
482 | <b class="navlabel">Next:</b> | |
483 | <a class="sectref" rel="next" href="request-objects.html">11.5.1 Request Objects</A> | |
484 | </div> | |
485 | </div> | |
486 | <hr /> | |
487 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
488 | </DIV> | |
489 | <!--End of Navigation Panel--> | |
490 | <ADDRESS> | |
491 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
492 | </ADDRESS> | |
493 | </BODY> | |
494 | </HTML> |