<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://performiq.com/kb/index.php?action=history&amp;feed=atom&amp;title=Python_-_urllib</id>
	<title>Python - urllib - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://performiq.com/kb/index.php?action=history&amp;feed=atom&amp;title=Python_-_urllib"/>
	<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;action=history"/>
	<updated>2026-05-18T15:05:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=4872&amp;oldid=prev</id>
		<title>PeterHarding at 06:48, 11 March 2017</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=4872&amp;oldid=prev"/>
		<updated>2017-03-11T06:48:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:48, 11 March 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= References =&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &lt;/del&gt;http://www.voidspace.org.uk/python/articles/urllib2.shtml&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Article from - &lt;/ins&gt;http://www.voidspace.org.uk/python/articles/urllib2.shtml&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= URLLIB Tutorial: urllib2 - The Missing Manual =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= URLLIB Tutorial: urllib2 - The Missing Manual =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== HOWTO Fetch Internet Resources with Python ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== HOWTO Fetch Internet Resources with Python ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=4643&amp;oldid=prev</id>
		<title>PeterHarding at 04:04, 1 August 2015</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=4643&amp;oldid=prev"/>
		<updated>2015-08-01T04:04:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:04, 1 August 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l439&quot;&gt;Line 439:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 439:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Python]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Python]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. &lt;/del&gt;httplib]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Python &lt;/ins&gt;httplib]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. &lt;/del&gt;urllib]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Python &lt;/ins&gt;urllib]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Internet]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Internet]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=3014&amp;oldid=prev</id>
		<title>PeterHarding at 01:29, 2 April 2009</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=3014&amp;oldid=prev"/>
		<updated>2009-04-02T01:29:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:29, 2 April 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l77&quot;&gt;Line 77:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 77:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Data ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Data ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sometimes you want to send data to a URL (often the URL will refer to a CGI (Common Gateway Interface) script &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://esbinfo:8090/pages/editpage.action#id8 ][1] &lt;/del&gt;or other web application). With HTTP, this is often done using what&amp;#039;s known as a &amp;lt;b&amp;gt;POST&amp;lt;/b&amp;gt; request. This is often what your browser does when you submit a HTML form that you filled in on the web. Not all POSTs have to come from forms: you can use a POST to transmit arbitrary data to your own application. In the common case of HTML forms, the data needs to be encoded in a standard way, and then passed to the Request object as the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;data&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; argument. The encoding is done using a function from the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urllib&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; library &amp;lt;i&amp;gt;not&amp;lt;/i&amp;gt; from &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urllib2&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sometimes you want to send data to a URL (often the URL will refer to a CGI (Common Gateway Interface) script or other web application). With HTTP, this is often done using what&amp;#039;s known as a &amp;lt;b&amp;gt;POST&amp;lt;/b&amp;gt; request. This is often what your browser does when you submit a HTML form that you filled in on the web. Not all POSTs have to come from forms: you can use a POST to transmit arbitrary data to your own application. In the common case of HTML forms, the data needs to be encoded in a standard way, and then passed to the Request object as the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;data&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; argument. The encoding is done using a function from the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urllib&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; library &amp;lt;i&amp;gt;not&amp;lt;/i&amp;gt; from &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urllib2&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l111&quot;&gt;Line 111:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 111:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We&amp;#039;ll discuss here one particular HTTP header, to illustrate how to add headers to your HTTP request.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We&amp;#039;ll discuss here one particular HTTP header, to illustrate how to add headers to your HTTP request.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Some websites &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://esbinfo:8090/pages/editpage.action#id9 ][2] &lt;/del&gt;dislike being browsed by programs, or send different versions to different browsers &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://esbinfo:8090/pages/editpage.action#id10 ][3] &lt;/del&gt;. By default urllib2 identifies itself as &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Python-urllib/x.y&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; (where &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;y&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; are the major and minor version numbers of the Python release, e.g. &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Python-urllib/2.5&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;), which may confuse the site, or just plain not work. The way a browser identifies itself is through the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;User-Agent&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; header &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://esbinfo:8090/pages/editpage.action#id11 ][4]&lt;/del&gt;. When you create a Request object you can pass a dictionary of headers in. The following example makes the same request as above, but identifies itself as a version of Internet Explorer &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://esbinfo:8090/pages/editpage.action#id12 ][5]&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Some websites dislike being browsed by programs, or send different versions to different browsers. By default urllib2 identifies itself as &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Python-urllib/x.y&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; (where &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;y&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; are the major and minor version numbers of the Python release, e.g. &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Python-urllib/2.5&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;), which may confuse the site, or just plain not work. The way a browser identifies itself is through the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;User-Agent&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; header. When you create a Request object you can pass a dictionary of headers in. The following example makes the same request as above, but identifies itself as a version of Internet Explorer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l131&quot;&gt;Line 131:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 131:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The response also has two useful methods. See the section on &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://esbinfo:8090/pages/editpage.action#info-and-geturl info and geturl] &lt;/del&gt;which comes after we have a look at what happens when things go wrong.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The response also has two useful methods. See the section on which comes after we have a look at what happens when things go wrong.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;section&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;section&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l387&quot;&gt;Line 387:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 387:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Proxies =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Proxies =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;b&amp;gt;urllib2&amp;lt;/b&amp;gt; will auto-detect your proxy settings and use those. This is through the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;ProxyHandler&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; which is part of the normal handler chain. Normally that&amp;#039;s a good thing, but there are occasions when it may not be helpful &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://esbinfo:8090/pages/editpage.action#id13 ][6]&lt;/del&gt;. One way to do this is to setup our own &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;ProxyHandler&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;, with no proxies defined. This is done using similar steps to setting up a [http://www.voidspace.org.uk/python/articles/authentication.shtml Basic Authentication] handler :&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;b&amp;gt;urllib2&amp;lt;/b&amp;gt; will auto-detect your proxy settings and use those. This is through the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;ProxyHandler&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; which is part of the normal handler chain. Normally that&amp;#039;s a good thing, but there are occasions when it may not be helpful. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;One way to do this is to setup our own &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;ProxyHandler&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;, with no proxies defined. This is done using similar steps to setting up a [http://www.voidspace.org.uk/python/articles/authentication.shtml Basic Authentication] handler :&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; proxy_support = urllib2.ProxyHandler({})&amp;lt;br /&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; opener = urllib2.build_opener(proxy_support)&amp;lt;br /&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; urllib2.install_opener(opener)&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; proxy_support = urllib2.ProxyHandler({})&amp;lt;br /&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; opener = urllib2.build_opener(proxy_support)&amp;lt;br /&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; urllib2.install_opener(opener)&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2723&amp;oldid=prev</id>
		<title>PeterHarding: /* Fetching URLs */</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2723&amp;oldid=prev"/>
		<updated>2008-11-12T06:27:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Fetching URLs&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:27, 12 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l67&quot;&gt;Line 67:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 67:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that urllib2 makes use of the same Request interface to handle all URL schemes. For example, you can make an FTP request like so :&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that urllib2 makes use of the same Request interface to handle all URL schemes. For example, you can make an FTP request like so :&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;div class=&amp;quot;pysrc&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&lt;/del&gt;&amp;gt;req&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;Request&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;ftp://example.com/&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;req = urllib2.Request(&amp;#039;ftp://example.com/&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the case of HTTP, there are two extra things that Request objects allow you to do: First, you can pass data to be sent to the server. Second, you can pass extra information (&amp;quot;metadata&amp;quot;) &amp;lt;i&amp;gt;about&amp;lt;/i&amp;gt; the data or the about request itself, to the server - this information is sent as HTTP &amp;quot;headers&amp;quot;. Let&amp;#039;s look at each of these in turn.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the case of HTTP, there are two extra things that Request objects allow you to do: First, you can pass data to be sent to the server. Second, you can pass extra information (&amp;quot;metadata&amp;quot;) &amp;lt;i&amp;gt;about&amp;lt;/i&amp;gt; the data or the about request itself, to the server - this information is sent as HTTP &amp;quot;headers&amp;quot;. Let&amp;#039;s look at each of these in turn.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2722&amp;oldid=prev</id>
		<title>PeterHarding: /* Fetching URLs */</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2722&amp;oldid=prev"/>
		<updated>2008-11-12T06:26:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Fetching URLs&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:26, 12 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l42&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Fetching URLs =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Fetching URLs =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The simplest way to use urllib2 is as follows :&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The simplest way to use urllib2 is as follows:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;div class=&amp;quot;pysrc&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&lt;/del&gt;&amp;gt;import&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;response&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urlopen&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;http://python.org/&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;html&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;response&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;read&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import urllib2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;response = urllib2.urlopen(&amp;#039;http://python.org/&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;html = response.read()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Many uses of urllib2 will be that simple (note that instead of an &amp;#039;http:&amp;#039; URL we could have used an URL starting with &amp;#039;ftp:&amp;#039;, &amp;#039;file:&amp;#039;, etc.). However, it&amp;#039;s the purpose of this tutorial to explain the more complicated cases, concentrating on HTTP.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Many uses of urllib2 will be that simple (note that instead of an &amp;#039;http:&amp;#039; URL we could have used an URL starting with &amp;#039;ftp:&amp;#039;, &amp;#039;file:&amp;#039;, etc.). However, it&amp;#039;s the purpose of this tutorial to explain the more complicated cases, concentrating on HTTP.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2721&amp;oldid=prev</id>
		<title>PeterHarding: /* Fetching URLs */</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2721&amp;oldid=prev"/>
		<updated>2008-11-12T06:25:52Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Fetching URLs&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:25, 12 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l50&quot;&gt;Line 50:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 50:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HTTP is based on requests and responses - the client makes requests and servers send responses. urllib2 mirrors this with a &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Request&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; object which represents the HTTP request you are making. In its simplest form you create a Request object that specifies the URL you want to fetch. Calling &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urlopen&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; with this Request object returns a response object for the URL requested. This response is a file-like object, which means you can for example call .read() on the response :&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HTTP is based on requests and responses - the client makes requests and servers send responses. urllib2 mirrors this with a &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Request&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; object which represents the HTTP request you are making. In its simplest form you create a Request object that specifies the URL you want to fetch. Calling &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urlopen&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; with this Request object returns a response object for the URL requested. This response is a file-like object, which means you can for example call .read() on the response :&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;div class=&amp;quot;pysrc&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&lt;/del&gt;&amp;gt;import&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;req&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;Request&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;http://www.voidspace.org.uk&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;response&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urlopen&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;req&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;the_page&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;response&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;read&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;&lt;/del&gt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;)&amp;lt;&lt;/del&gt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&amp;lt;&lt;/del&gt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;span&amp;gt;&lt;/del&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;div&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import urllib2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;req = urllib2.Request(&amp;#039;http://www.voidspace.org.uk&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;response = urllib2.urlopen(req)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the_page = response.read&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Note that urllib2 makes use of the same Request interface to handle all URL schemes. For example, you can make an FTP request like so :&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;req &lt;/ins&gt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;urllib2.Request&lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;ftp:&lt;/ins&gt;//&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;example.com&lt;/ins&gt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that urllib2 makes use of the same Request interface to handle all URL schemes. For example, you can make an FTP request like so :&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that urllib2 makes use of the same Request interface to handle all URL schemes. For example, you can make an FTP request like so :&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2720&amp;oldid=prev</id>
		<title>PeterHarding: /* Data */</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2720&amp;oldid=prev"/>
		<updated>2008-11-12T06:25:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Data&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:25, 12 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l64&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sometimes you want to send data to a URL (often the URL will refer to a CGI (Common Gateway Interface) script [http://esbinfo:8090/pages/editpage.action#id8 ][1] or other web application). With HTTP, this is often done using what&amp;#039;s known as a &amp;lt;b&amp;gt;POST&amp;lt;/b&amp;gt; request. This is often what your browser does when you submit a HTML form that you filled in on the web. Not all POSTs have to come from forms: you can use a POST to transmit arbitrary data to your own application. In the common case of HTML forms, the data needs to be encoded in a standard way, and then passed to the Request object as the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;data&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; argument. The encoding is done using a function from the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urllib&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; library &amp;lt;i&amp;gt;not&amp;lt;/i&amp;gt; from &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urllib2&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sometimes you want to send data to a URL (often the URL will refer to a CGI (Common Gateway Interface) script [http://esbinfo:8090/pages/editpage.action#id8 ][1] or other web application). With HTTP, this is often done using what&amp;#039;s known as a &amp;lt;b&amp;gt;POST&amp;lt;/b&amp;gt; request. This is often what your browser does when you submit a HTML form that you filled in on the web. Not all POSTs have to come from forms: you can use a POST to transmit arbitrary data to your own application. In the common case of HTML forms, the data needs to be encoded in a standard way, and then passed to the Request object as the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;data&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; argument. The encoding is done using a function from the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urllib&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; library &amp;lt;i&amp;gt;not&amp;lt;/i&amp;gt; from &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;urllib2&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;div class=&amp;quot;pysrc&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&lt;/del&gt;&amp;gt;import&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;import&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;url&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;http://www.someserver.com/cgi-bin/register.cgi&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;values&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;name&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;Michael Foord&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;location&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;Northampton&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;language&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;Python&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;}&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;data&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urlencode&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;values&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;req&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;Request&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;url&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;data&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;response&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urlopen&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;req&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;the_page&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;response&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;read&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import urllib&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import urllib2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;url = &amp;#039;http://www.someserver.com/cgi-bin/register.cgi&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;values = {&amp;#039;name&amp;#039; : &amp;#039;Michael Foord&amp;#039;,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;location&amp;#039; : &amp;#039;Northampton&amp;#039;,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;language&amp;#039; : &amp;#039;Python&amp;#039; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;data = urllib.urlencode(values)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;req = urllib2.Request(url, data)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;response = urllib2.urlopen(req)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the_page = response.read()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that other encodings are sometimes required (e.g. for file upload from HTML forms - see [http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13 HTML Specification, Form Submission] for more details).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that other encodings are sometimes required (e.g. for file upload from HTML forms - see [http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13 HTML Specification, Form Submission] for more details).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2719&amp;oldid=prev</id>
		<title>PeterHarding: /* Headers */</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2719&amp;oldid=prev"/>
		<updated>2008-11-12T06:24:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Headers&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:24, 12 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l84&quot;&gt;Line 84:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 84:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Some websites [http://esbinfo:8090/pages/editpage.action#id9 ][2] dislike being browsed by programs, or send different versions to different browsers [http://esbinfo:8090/pages/editpage.action#id10 ][3] . By default urllib2 identifies itself as &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Python-urllib/x.y&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; (where &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;y&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; are the major and minor version numbers of the Python release, e.g. &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Python-urllib/2.5&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;), which may confuse the site, or just plain not work. The way a browser identifies itself is through the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;User-Agent&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; header [http://esbinfo:8090/pages/editpage.action#id11 ][4]. When you create a Request object you can pass a dictionary of headers in. The following example makes the same request as above, but identifies itself as a version of Internet Explorer [http://esbinfo:8090/pages/editpage.action#id12 ][5].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Some websites [http://esbinfo:8090/pages/editpage.action#id9 ][2] dislike being browsed by programs, or send different versions to different browsers [http://esbinfo:8090/pages/editpage.action#id10 ][3] . By default urllib2 identifies itself as &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Python-urllib/x.y&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; (where &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;y&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; are the major and minor version numbers of the Python release, e.g. &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;Python-urllib/2.5&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;), which may confuse the site, or just plain not work. The way a browser identifies itself is through the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;User-Agent&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; header [http://esbinfo:8090/pages/editpage.action#id11 ][4]. When you create a Request object you can pass a dictionary of headers in. The following example makes the same request as above, but identifies itself as a version of Internet Explorer [http://esbinfo:8090/pages/editpage.action#id12 ][5].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;div class=&amp;quot;pysrc&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&lt;/del&gt;&amp;gt;import&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;import&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;url&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;http://www.someserver.com/cgi-bin/register.cgi&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;user_agent&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;values&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;name&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;Michael Foord&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;location&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;Northampton&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;language&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;Python&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;}&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;headers&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;User-Agent&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;user_agent&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;}&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;data&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urlencode&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;values&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;req&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;Request&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;url&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;data&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;headers&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;response&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urlopen&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;req&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;the_page&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;response&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;read&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import urllib&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import urllib2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;url = &amp;#039;http://www.someserver.com/cgi-bin/register.cgi&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;user_agent = &amp;#039;Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;values = {&amp;#039;name&amp;#039; : &amp;#039;Michael Foord&amp;#039;,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;location&amp;#039; : &amp;#039;Northampton&amp;#039;,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;language&amp;#039; : &amp;#039;Python&amp;#039; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;headers = { &amp;#039;User-Agent&amp;#039; : user_agent }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;data = urllib.urlencode(values)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;req = urllib2.Request(url, data, headers)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;response = urllib2.urlopen(req)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the_page = response.read()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The response also has two useful methods. See the section on [http://esbinfo:8090/pages/editpage.action#info-and-geturl info and geturl] which comes after we have a look at what happens when things go wrong.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The response also has two useful methods. See the section on [http://esbinfo:8090/pages/editpage.action#info-and-geturl info and geturl] which comes after we have a look at what happens when things go wrong.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2718&amp;oldid=prev</id>
		<title>PeterHarding: /* Error Codes */</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2718&amp;oldid=prev"/>
		<updated>2008-11-12T06:24:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Error Codes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;https://performiq.com/kb/index.php?title=Python_-_urllib&amp;amp;diff=2718&amp;amp;oldid=2717&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2717&amp;oldid=prev</id>
		<title>PeterHarding: /* Number 1 */</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=Python_-_urllib&amp;diff=2717&amp;oldid=prev"/>
		<updated>2008-11-12T06:22:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Number 1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:22, 12 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l141&quot;&gt;Line 141:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 141:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Number 1 ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Number 1 ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;div class=&amp;quot;pysrc&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&lt;/del&gt;&amp;gt;from&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urllib2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;import&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;Request&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urlopen&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;URLError&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;HTTPError&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;req&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;Request&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;someurl&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;try&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;response&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class&lt;/del&gt;=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;urlopen&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;req&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;except&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;HTTPError&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;e&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;print&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;The server couldn&amp;#039;t fulfill the request.&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;print&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;Error code: &amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;e&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;code&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;except&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;URLError&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;e&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;print&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;We failed to reach a server.&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;print&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pystring&amp;quot;&amp;gt;&lt;/del&gt;&amp;#039;Reason: &amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;e&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&lt;/del&gt;reason&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pykeyword&amp;quot;&amp;gt;&lt;/del&gt;else&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pyoperator&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span class=&amp;quot;pycomment&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/del&gt;# everything is fine&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nowiki&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;pytext&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;note&amp;quot;&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from urllib2 import Request, urlopen, URLError, HTTPError&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;req = Request(someurl)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;try:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;response = urlopen(req)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;except HTTPError, e:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;print &amp;#039;The server couldn&amp;#039;t fulfill the request.&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;print &amp;#039;Error code: &amp;#039;, e.code&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;except URLError, e:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;print &amp;#039;We failed to reach a server.&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;print &amp;#039;Reason: &amp;#039;, e.reason&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;else:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# everything is fine&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Note====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Note====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
</feed>