title: How to avoid hangings when scraping JSON formatted data from API URL using Python
body: <p>I've been parsing the data (keys and values) from JSON formatted API URL using Python. My code has been running without any problem for three weeks. But since three days ago, Python suddenly fails to run my code and doesn't collect the data to the end.</p>
  
  <p>The weird thing is that terminal doesn't show any error or doesn't automatically stops running, but it just hangs there and doesn't move on (as if it it were trapped in a infinite loop). To be simple, I'm using a <code>for</code> loop to iterate through all the elements (product IDs) in a list and try to get the corresponding keys and values.</p>
  
  <p>When Python hangs, there's no particular pattern. I googled and added this on my code:</p>
  
  <pre><code>for i in product_list:
       try:
           # Collecting the data
       except:
           pass
       else:
           continue
  </code></pre>
  
  <p>After adding this code, Python goes a way further (collecting more data before it hangs again) than before, but it still hangs at a random point. Is there a way to avoid this type of issue? I tried to describe my issue as much as possible but this time I can't even find out what the error is.</p>