Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
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
Exemplo n.º 4
0
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