How can I Improve validation / performance for non-stop and start over the last item?

I want to improve my logic in this simple script that if stops or crashes or re-execute the script then start over from the last recorded item in the JSON, and find in the bulk link the position to start again from that, but my question. how can I properly handle this to do a non-stop?

        demo = feedparser.parse(url)
          'url': url,
          'version': demo.version,
        with open('json.json', 'r') as json_file:
          load_data = json.load(json_file)
          for p in load_data['news']:
            if len(p['url']) < 1:
              with open('json.json', 'a+') as rss:
                json.dump(data, rss)
            elif load_data['news'][-1]['url'] in url:
      except Exception as e:

Read more here:

Content Attribution

This content was originally published by Raul Delgado de Luna at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: