Fetch HTML From URL in Python
<p>I am trying to read the <code>HTML</code> contents of a <code>URL</code> with <code>Python</code>. To fetch the <code>HTML</code> contents of a <code>URL</code>, would I use the module <code>wget</code>, <code>urllib</code> or a different module entirely? </p>

<p>After Answers: 
I will use the <code>urllib</code> module since that comes with the default Python 2.7 build, and I can't download external modules from this computer.</p>

<p>List of Modules That Fetch URL Contents:</p>

<pre><code>Wget
Beautiful Soup
Urllib
Requests
</code></pre>

<p>Here is a sample to get you started with <a href="http://docs.python-requests.org/en/master/" rel="nofollow"><code>requests</code></a>:</p>

<pre><code>import requests

resp = requests.get('http://httpbin.org/get')
if resp.ok:
    print (resp.text)
else:
    print ("Boo! {}".format(resp.status_code))
    print (resp.text)
</code></pre>

python html url