<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: urllib2 code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 08 Aug 2008 12:02:51 GMT</pubDate>
    <description>DZone Snippets: urllib2 code</description>
    <item>
      <title>Python - Change user-agent</title>
      <link>http://snippets.dzone.com/posts/show/3015</link>
      <description>// Cambiare user-agent con urllib&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import urllib&lt;br /&gt;&lt;br /&gt;class AppURLopener(urllib.FancyURLopener):&lt;br /&gt;&lt;br /&gt;	version = 'Nokia6630/1.0 (2.3.129) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1'&lt;br /&gt;&lt;br /&gt;urllib._urlopener = AppURLopener()&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;// Cambiare user-agent con urllib2&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import urllib2&lt;br /&gt;&lt;br /&gt;headers = { 'user-agent':'Nokia6630/1.0 (2.3.129) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1',&lt;br /&gt;		    'keep-alive':'300',&lt;br /&gt;		    'content-type':'application/x-www-form-urlencoded'&lt;br /&gt;		  }&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 18 Nov 2006 15:14:46 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3015</guid>
      <author>whitetiger ()</author>
    </item>
  </channel>
</rss>
