<div>Hi there,</div><div> I think there is a small mistake at the following url and snippet I added. the last line <br>"data = urllib2.open(full_url)" is giving attribute error, I think it must be urllib2.urlopen(full_url) right?</div>
<div><br></div><div><br></div><div>thanks a lot</div><div><br></div><div><br></div>URL:<br><div><a href="http://docs.python.org/howto/urllib2.html">http://docs.python.org/howto/urllib2.html</a></div><div><br></div><div><br>
</div><div>ERROR SECTION:</div><div><span class="Apple-style-span" style="font-family: sans-serif; font-size: 16px; "><pre style="overflow-x: auto; overflow-y: hidden; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; background-color: rgb(238, 255, 204); color: rgb(51, 51, 51); line-height: 15px; border-top-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-bottom-style: solid; border-top-color: rgb(170, 204, 153); border-bottom-color: rgb(170, 204, 153); border-left-style: none; border-left-width: initial; border-left-color: initial; border-right-style: none; border-right-width: initial; border-right-color: initial; ">
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="kn" style="color: rgb(0, 112, 32); font-weight: bold; ">import</span> <span class="nn" style="color: rgb(14, 132, 181); font-weight: bold; ">urllib2</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="kn" style="color: rgb(0, 112, 32); font-weight: bold; ">import</span> <span class="nn" style="color: rgb(14, 132, 181); font-weight: bold; ">urllib</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="n">data</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="p">{}</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="n">data</span><span class="p">[</span><span class="s" style="color: rgb(64, 112, 160); ">'name'</span><span class="p">]</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="s" style="color: rgb(64, 112, 160); ">'Somebody Here'</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="n">data</span><span class="p">[</span><span class="s" style="color: rgb(64, 112, 160); ">'location'</span><span class="p">]</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="s" style="color: rgb(64, 112, 160); ">'Northampton'</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="n">data</span><span class="p">[</span><span class="s" style="color: rgb(64, 112, 160); ">'language'</span><span class="p">]</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="s" style="color: rgb(64, 112, 160); ">'Python'</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="n">url_values</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="n">urllib</span><span class="o" style="color: rgb(102, 102, 102); ">.</span><span class="n">urlencode</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="k" style="color: rgb(0, 112, 32); font-weight: bold; ">print</span> <span class="n">url_values</span>
<span class="go" style="color: rgb(48, 48, 48); ">name=Somebody+Here&language=Python&location=Northampton</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="n">url</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="s" style="color: rgb(64, 112, 160); ">'<a href="http://www.example.com/example.cgi">http://www.example.com/example.cgi</a>'</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="n">full_url</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="n">url</span> <span class="o" style="color: rgb(102, 102, 102); ">+</span> <span class="s" style="color: rgb(64, 112, 160); ">'?'</span> <span class="o" style="color: rgb(102, 102, 102); ">+</span> <span class="n">url_values</span>
<span class="gp" style="color: rgb(198, 93, 9); font-weight: bold; ">>>> </span><span class="n">data</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="n">urllib2</span><span class="o" style="color: rgb(102, 102, 102); ">.</span><span class="n">open</span><span class="p">(</span><span class="n">full_url</span><span class="p">)</span></pre>
</span></div>