From e7154b4975593a1a53f4ba8a6764f6b438ce0e3d Mon Sep 17 00:00:00 2001 From: Trowbridge Date: Wed, 18 Dec 2019 16:23:48 -0500 Subject: [PATCH] loop through each stored url --- version.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/version.py b/version.py index b8236f6..71680dd 100644 --- a/version.py +++ b/version.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import psycopg2 +import wget import sys con = None @@ -14,8 +15,9 @@ try: cur = con.cursor() cur.execute('SELECT code, url FROM scrape.raw') - version = cur.fetchone()[1] - print(version) + urls = cur.fetchall() + for row in urls: + print(row[0],row[1]) except psycopg2.DatabaseError as e: