def get_all_funds(self): for i in sorted(WEB_PAGES.keys()): f = WEB_PAGES[i]['file'] if os.path.exists(f): self.analyze(f) else: print "File %s does not exist!" % f return self.ALL_FUNDS
def download_all_webpages(): for i in sorted(WEB_PAGES.keys()): try: url = WEB_PAGES[i]["url"] target_file = WEB_PAGES[i]["file"] print "Downloading %s......" % url f = urllib2.urlopen(url) with open(target_file, 'w') as tf: tf.write(f.read()) except Exception as ex: print str(ex) break