title: How to fetch all of pages(from pagination) using urllib2.urlopen?
body: <p>I want to fetch all pages and parse them until there is no load-more url in response(link variable). Could any one show me how i can modify the following code so it fetches all the pages till there is no load-more URL in response(link variable) ?</p>
  
  <pre><code>import urllib2,re
  
  Fromurl = "https://somesite.com/n/series/123456/";
  
  req = urllib2.Request(Fromurl)
  req.add_header('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36')
  response = urllib2.urlopen(req)
  link=response.read()
  print "value of link here:"
  print link
  response.close()
  
  //try to parse response here
  
  #################### here we get next page url###################
  matchNextPageUrl =re.findall('loadmore', link, re.UNICODE)
  print "value of matchNextPageUrl [0][0]"
  
  print "https://somesite.com/n/series/nexpage"+matchNextPageUrl[0][0]+".sort-number:DESC.pageNumber-1";
  </code></pre>