NameError: name 're' is not defined
<p>I am very new to python. Very new. I copied the following from a tutorial</p>

<pre><code>#!/usr/bin/python
import re
from urllib import urlopen
from BeautifulSoup import BeautifulSoup

webpage = urlopen('http://feeds.huffingtonpost.com/huffingtonpost/LatestNews').read

patFinderTitle = re.compile('&lt;title&gt;(.*)&lt;/title&gt;')

patFinderLink = re.compile('&lt;link rel.*href="(.*)"/&gt;')

findPatTitle = re.findall(patFinderTitle,webpage)

findPatLink = re.findall(patFinderLink,webpage)

listIterator = []
listIterator[:] = range(2,16)

for i in listIterator:
    print findPatTitle[i]
    print findPatLink[i]
    print "\n"
</code></pre>

<p>I get the error: </p>

<pre><code>Traceback (most recent call last):
  File "test.py", line 8, in &lt;module&gt;
    patFinderTitle = re.compile('&lt;title&gt;(.*)&lt;/title&gt;')
NameError: name 're' is not defined
</code></pre>

<p>What am I doing wrong?</p>

<p>Edit: I added <code>import re</code> but now get the following:</p>

<pre><code>File "/scripts/_prod/test.py", line 13, in &lt;module&gt;
    findPatTitle = re.findall(patFinderTitle,webpage)
  File "/usr/lib64/python2.6/re.py", line 177, in findall
    return _compile(pattern, flags).findall(string)
TypeError: expected string or buffer
</code></pre>
