title: Error in Python Mechanize - "mechanize._mechanize.BrowserStateError: not viewing HTML"
body: <pre><code>for link in br.links(url_regex="inquiry-results.jsp"):
      cb[link.url] = link
  
  for page_link in cb.values():               
     for link in br.links(url_regex="inquiryDetail.jis"): 
              ....................
        url = link.absolute_url
        br.follow_link(link)
              ......................
     br.follow_link(page_link)
  </code></pre>
  
  <p>This is my code. Basically, it extracts page links [Link of page 1,2,3,4,5...] and data links from particular page. Then it goes in each data link and extracts some data and when done it moves to the next page. But I always get this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\python27\test.py", line 95, in &lt;module&gt;
      for link in br.links(url_regex="inquiryDetail.jis"):
    File "build\bdist.win32\egg\mechanize\_mechanize.py", line 405, in links
  mechanize._mechanize.BrowserStateError: not viewing HTML
  </code></pre>
  
  <p>Can anyone help?</p>