title: Python urllib2 request blinking cursor no response
body: <p>I'm trying to extract data from BBB but I get no response. I don't get any error messages, just a blinking cursor. Is it my regex that is the issue? Also, if you see anything that I can improve on in terms of efficiency or coding style, I 
  am open to your advice!  </p>
  
  <p>Here is the code:</p>
  
  <pre><code>import urllib2
  import re
  
  print "Enter an industry keyword."
  print "Example: florists, construction, tiles"
  
  keyword = raw_input('&gt; ')
  
  print "How many pages to dig through BBB?"
  total_pages = raw_input('&gt; ')
  
  print "Working..."
  
  page_number = 1
  address_list = []
  
  url = 'https://www.bbb.org/search/?type=category&amp;input=' + keyword + '&amp;filter=business&amp;page=' + str(page_number)
  
  req = urllib2.Request(url)
  req.add_header('User-agent', 'Mozilla/5.0')
  resp = urllib2.urlopen(req)
  respData = resp.read()
  
  address_pattern = r'&lt;address&gt;(.*?)&lt;\/address&gt;'
  
  while page_number &lt;= total_pages:
  
      business_address = re.findall(address_pattern,str(respData))
  
      for each in business_address:
          address_list.append(each)
  
      page_number += 1
  
  for each in address_list:
      print each
  
  print "\n Save to text file? Hit ENTER if so.\n"
  raw_input('&gt;')
  
  file = open('export.txt','w')
  
  for each in address_list:
      file.write('%r \n' % each)
  
  file.close()
  
  print 'File saved!'
  </code></pre>
  
  <p><strong>EDITED, but still don't get any results:</strong></p>
  
  <pre><code>import urllib2
  import re
  
  print "Enter an industry keyword."
  print "Example: florists, construction, tiles"
  
  keyword = raw_input('&gt; ')
  
  print "How many pages to dig through BBB?"
  total_pages = int(raw_input('&gt; '))
  
  print "Working..."
  
  page_number = 1
  address_list = []
  
  for page_number in range(1,total_pages):
  
      url = 'https://www.bbb.org/search/?type=category&amp;input=' + keyword + '&amp;filter=business&amp;page=' + str(page_number)
  
      req = urllib2.Request(url)
      req.add_header('User-agent', 'Mozilla/5.0')
      resp = urllib2.urlopen(req)
      respData = resp.read()
  
      address_pattern = r'&lt;address&gt;(.*?)&lt;\/address&gt;'
  
      business_address = re.findall(address_pattern,respData)
  
      address_list.extend(business_address)
  
  for each in address_list:
      print each
  
  print "\n Save to text file? Hit ENTER if so.\n"
  raw_input('&gt;')
  
  file = open('export.txt','w')
  
  for each in address_list:
      file.write('%r \n' % each)
  
  file.close()
  
  print 'File saved!'
  </code></pre>