擅长:python、mysql、java
<p>看起来您遇到了代理问题。关于如何解决这个问题,这里有一个很好的解释:
<a href="https://stackoverflow.com/questions/8761583/trying-to-access-the-internet-using-urllib2-in-python">Trying to access the Internet using urllib2 in Python</a>。</p>
<p>我已经在我的ubuntu上用python 2.7.3执行了你的代码,没有看到任何错误。</p>
<p>另外,考虑使用<a href="http://docs.python-requests.org/en/latest/" rel="nofollow noreferrer">requests</a>:</p>
<pre><code>import requests
response = requests.get("http://casacinema.eu/movie-film-Matrix+trilogy+123+streaming-6165.html", timeout=5)
print response.status_code
</code></pre>
<p>另见:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/8287628/proxies-with-python-requests-module">Proxies with Python 'Requests' module</a></li>
</ul>