title: How to be Sure that page downloaded is complete by python
body: <p>I am downloading a JSON based huge page, most of the time it is downloaded successfully but sometimes, its downloading partially. How can I sure that download completed.</p>
  
  <p>My example code is as follows:</p>
  
  <pre><code>mac_sonuclari_url = "http://mservice.fanatik.com.tr/LeagueStage?TournamentID={}&amp;includeFixture=1"
  with urllib.request.urlopen(mac_sonuclari_url.format(1)) as url:
       try:
           data = json.loads(url.read().decode())    
       except Exception as err:
           logging.error("{}: Error Getting URL: {} with Error: {}".format(fna, mac_sonuclari_url.format(1), err))
  </code></pre>
  
  <p>unfortunately, I can't catch partial download by Try - Except. 
  Then my code breaks as it doesn't catch all data needed.
  Is there any way to understand that page loaded completely?
  Thanks a lot</p>