title: Trying to use Python Mechanize to fill in search box contained in <td> tags
body: <p>I'm brand new to Python and am attempting to scrape information from a real estate listing website (www.realtor.ca).  So far, I've managed to collect MLS numbers in a list using this code:</p>
  
  <pre><code>import urllib2, sys, re, mechanize, itertools, csv
  
  # Set the url for the online search
  url = 'http://www.realtor.ca/PropertyResults.aspx?Page=1&amp;vs=Residential&amp;ret=300&amp;curPage=PropertySearch.aspx&amp;sts=0-0&amp;beds=0-0&amp;baths=0-0&amp;ci=Victoria&amp;pro=3&amp;mp=200000-300000-0&amp;mrt=0-0-4&amp;trt=2&amp;of=1&amp;ps=10&amp;o=A'
  content = urllib2.urlopen(url).read()
  text = str(content)
  
  # finds all instances of "MLS&amp;reg;: " to create a list of MLS numbers
  # "[0-9]+" matches all numbers (the plus means one or more) In this case it's looking for a 6-digit MLS number
  findMLS = re.findall("MLS&amp;reg;: [0-9]+", text)
  findMLS = [x.strip('MLS&amp;reg;: ') for x in findMLS]
  
  # "Page 1 of " precedes the number of pages in the search result (10 listings per page)
  num_pages = re.findall("Page 1 of [0-9]+", text)
  num_pages = [y.strip('Page 1 of ') for y in num_pages]
  
  pages = int(num_pages[0])
  for page in range(2,pages+1):
  # Update the url with the different search page numbers
  url_list = list(url)
  url_list[48] = str(page)
  url = "".join(url_list)
  # Read the new url to get more MLS numbers
  content = urllib2.urlopen(url).read()
  text = str(content)
  newMLS = re.findall("MLS&amp;reg;: [0-9]+", text)
  newMLS = [x.strip('MLS&amp;reg;: ') for x in newMLS]
  # Append new MLS numbers to the list findMLS
  for number in newMLS:
      findMLS.append(number)
  </code></pre>
  
  <p>With my list of MLS numbers (findMLS), I'd like to input each number into the MLS# search box at the top of this website: <a href="http://www.realtor.ca/propertySearch.aspx" rel="nofollow">http://www.realtor.ca/propertySearch.aspx</a></p>
  
  <p>Using inspect element I can find this search box, but I don't know how to use Python code and Mechanize to access it.</p>
  
  <pre><code>&lt;input type="text" id="txtMlsNumber" value="" style="background-color:#ebebeb;border:solid 1px #C8CACA; " onkeypress="javascript:MLSNumberSearch(event)"&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>